Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

select distinct and select first

Status
Not open for further replies.

scottshiv

MIS
Sep 13, 2002
47
US
I'm a bit confused about how those work:

field1 field2 field3
aa 12345 333
aa 34567 444
aa 45678 555

Using the above:

If I do a select distinct field1,field2,field3 I will get all three records because they are not exact duplicates, right?

Now what about select first. I want only the first record.
Do I do a select first field1, field2, field3 Or do I do select field1, first field2, first field3?
 
Have you tried this ?
SELECT field1, First(field2), First(field3)
FROM yourTable
GROUP BY field1;

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top