M
Martin Dashper
I have a table which is keyed on Field1, Field2 and TiebreakField.
Field1 and 2 can contain duplicates and the tiebreakField only applies
to it's own set of duplicates ie. each set of duplicates in Field1 and
2 may have different range of tiebreak values (I know it sounds
complicated, but the tiebreak values are generated externally)
For example:
Rec1 Field1 = 100 Field2 = "ABC" TiebreakField = 35
Rec2 Field1 = 100 Field2 = "ABC" TiebreakField = 36
Rec3 Field1 = 200 Field2 = "XYZ" TiebreakField = 20
Rec4 Field1 = 200 Field2 = "XYZ" TiebreakField = 21
What I want is a SQL query which will select records where the
tiebreakField has the maximum value. Hence, in the above example, I
want to select Rec2 and Rec4
Martin Dashper
Field1 and 2 can contain duplicates and the tiebreakField only applies
to it's own set of duplicates ie. each set of duplicates in Field1 and
2 may have different range of tiebreak values (I know it sounds
complicated, but the tiebreak values are generated externally)
For example:
Rec1 Field1 = 100 Field2 = "ABC" TiebreakField = 35
Rec2 Field1 = 100 Field2 = "ABC" TiebreakField = 36
Rec3 Field1 = 200 Field2 = "XYZ" TiebreakField = 20
Rec4 Field1 = 200 Field2 = "XYZ" TiebreakField = 21
What I want is a SQL query which will select records where the
tiebreakField has the maximum value. Hence, in the above example, I
want to select Rec2 and Rec4
Martin Dashper