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

Selecting the most recent

Status
Not open for further replies.

markj11

Programmer
Mar 24, 2006
11
US
I have:
FieldA FieldB FieldC
A 1 10/10/2000
A 1 10/11/2000
A 1 10/09/2000
B 1 11/11/2000
B 1 11/09/2000

How do I get:
A 1 10/11/2000
B 1 11/11/2000

Thanks
 
SELECT t1.FieldA, t1.FieldB, t1.FieldC
from mytable t1
WHERE t1.FieldC in
(Select Top 1 FieldC from mytable t2
WHERE t1.FieldA=t2.FieldA and t1.FieldB=t2.FieldB
order by t2.FieldC DESC)

-DNG
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top