Unique part of a record

samjesse

Registered User.
Local time
Today, 08:16
Joined
Feb 13, 2009
Messages
64
Hello

Please suggest a way to do this. Thanks in advance.

I have a table with data like this
Field_1,Field_2,Field_3
A,B,5
A,B,3
A,C,7
A,C,6
X,Y,4
X,Y,3

I need a report where I can only see
A,B,5
A,C,7
X,Y,4

That is Group by Field_1 and only show the records which has Field_2 with the max. value of Field_3

Many thx
 
Remember to change the field name and table name to yours.
SELECT DISTINCT Field_1, Field_2, Max(Table1.Field_3) AS Field_3
FROM Table1
GROUP BY Field_1, Field_2;
 

Users who are viewing this thread

Back
Top Bottom