Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 select the latest revision - over my head!

Author  Topic 

ASP_DRUG_DEALER
Yak Posting Veteran

61 Posts

Posted - 2005-12-08 : 15:51:48
Hey all-
I need to select the latest revision from a table and am having no luck.

doc_id, rev_number
123, 1
123, 2
123, 4
456, 1
456, 2

I need to be able to get document (123,4) and (456,2).

Thanks,
Doug

SreenivasBora
Posting Yak Master

164 Posts

Posted - 2005-12-08 : 15:56:03
select doc_id,max(rev_number) from Test
group by doc_id

With Regards
BSR
Go to Top of Page
   

- Advertisement -