Forums before death by AOL, social media and spammers... "We can't have nice things"
|    comp.databases.ms-sqlserver    |    Notorious Rube Goldberg contraption    |    19,505 messages    |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
|    Message 17,867 of 19,505    |
|    Gert-Jan Strik to All    |
|    Re: Simple (?) SQL problem    |
|    31 Jul 10 14:57:07    |
      46985af9       From: sorrytoomuchspamalready@xs4all.nl              I don't think there is a solution that will embarrass you.              Try this:               SELECT DocID, Version, VersionID        FROM (        SELECT DocID, Version, VersionID        , ROW_NUMBER() OVER (PARTITION BY DocID ORDER BY Version DESC) AS rn        FROM tblDocumentVersion        ) T        WHERE rn=1              --       Gert-Jan              --- SoupGate-Win32 v1.05        * Origin: you cannot sedate... all the things you hate (1:229/2)    |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
(c) 1994, bbs@darkrealms.ca