If you have a table called vendor2 and you want distinct records based on a field (tin in this case) and then for the query to grab all the other fields use the following sql as a guide. The table must have a primary key (pk in this case). You can also use min on the primary key field.
SELECT vendor2.*
FROM vendor2, (SELECT tin, max(pk) as pk2 FROM vendor2 GROUP BY tin) AS pull
WHERE vendor2.pk=pull.pk2;
|