I am still finding my feet with sql server but I am having a problem trying to solve a query issue.
I want to allow users to upload different versions of documents. However I want them to be able to access the previous versions if they need to.
Below, is some info (there are other fields, but not necessary here) from a table 'file_resources':
INNER JOIN (SELECT file_name, MAX(Version) as MaxVersion
FROM MyTable as MT
GROUP BY file_name
) as T ON
MyTable.file_name = T.file_name AND
MyTable.Version = T.MaxVersion
With kind regards . . . . . SQL Server 2000/2005/2012
Grabel's Law: 2 is not equal to 3 -- not even for very large values of 2. Pat Phelan's Law: 2 very definitely CAN equal 3 -- in at least two programming languages