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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Distinct values of a combination of two fields 1

Status
Not open for further replies.

laina222

Technical User
Sep 7, 2001
172
US
This is probably an easy one, I've just never done it before...

In my table, I have two fields for which I want to find distinct values for a combination of the two fields. I also want to include other fields in my results as part of the SELECT statement.

Any ideas? Thanks for any help in advance :)
 
The General approach is
Code:
Select Fld1, Fld2, XX(Fld3), XX(Fld4), ...

From tbl

Group By Fld1, Fld2

Where "XX" is an aggregate function that specifies which of the values in the other fields that you want to see. It may be FIRST, LAST, MIN, MAX, SUM, AVG and may be different for each of the fields.
 
Thanks for your help! I've finally got it figured out...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top