Get all Unique composite pair of records

creek

New member
Local time
Today, 10:28
Joined
Jul 21, 2006
Messages
3
I will try to explain this in as detail as possible. I have One table having numerous columns.
Columns
RowNumber <primary key>
A
E
B
C
D


Now what I am trying to do is retrieve all records in this table where the combination of A and E is unique. e.g. if table looks like

Row A E B C D
1 1 1 blah blah blah
2 2 1 blah blah blah
3 2 2 blah blah blah
4 2 1 blah blah blah
5 3 2 blah blah blah
6 3 3 blah blah blah

When I Run a query I should get only the following records

Row A E B C D
1 1 1 blah blah blah
3 2 2 blah blah blah
5 3 2 blah blah blah
6 3 3 blah blah blah

I want all such records where combination of A and E is unique.
 
Just to start you out:
SELECT [A], [E], MAX(), MAX([C]), MAX([D])
FROM MyTable
GROUP BY [A],[E]
ORDER BY [A]. [E]
 

Users who are viewing this thread

Back
Top Bottom