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
 SQL Server Development (2000)
 select

Author  Topic 

gaucho
Starting Member

2 Posts

Posted - 2002-03-19 : 13:50:49
hi,

How can I construct a SELECT query which select only the latest version of my document??

for eg: I have a same document with different versions... 1,2,3 etc.... I need to select the document which has the latest version ..in this case 3

wud appreciate any help..

TIa,
sands

JamesT
Yak Posting Veteran

97 Posts

Posted - 2002-03-19 : 14:01:06
Why not something like:

select max(version) from table



Go to Top of Page

Jay99

468 Posts

Posted - 2002-03-19 : 14:05:44
What is the datatype of the version field and what is the set of all possible version? If the versions will always be integers (even if its a varchar field) then the max(version) solution will work. If you have version like {'2.1.428 - Draft', 'Final Release', 'x.2 Beta'} you may need a more comprehensive solution.

Jay
<O>
Go to Top of Page
   

- Advertisement -