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

finding all the latest records

Status
Not open for further replies.

basbrian

Programmer
Feb 18, 2002
49
AU
I have a table that(in short) has a document no field and a version no field ie
document no version no
1 1
1 2
2 1
3 1
3 2
3 3
how do I get the following returned
document no version no
1 2
2 1
3 3
ie I only want the document and the highest version returned
 
Select DocumentNumber, Max(VersionNumber) As MaxVersionNumber From TableName Group By DocumentNumber

-George

Strong and bitter words indicate a weak cause. - Fortune cookie wisdom
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top