I am working on this document library and I want to display only the latest versions of the available document titles. For example, under the Analysis document type, there are the Hardware document title (Analysis_Hardware) and the Software document title (Analysis_Software). These document titles have multiple version numbers to them.
I've already got the SQL statement that looks for that record(document title) which has the highest version number. My problem is, I think it only works for scenarios where there is just one existing document title under a document type. I need an SQL statement that returns the latest version of ALL existing document titles under a document type. Meaning, the latest versions of Analysis_Hardware and Analysis_Software should appear. Please help! =)
This is my SQL statement:
SELECT Doctype, Title, Version, ReleaseDate FROM Document
WHERE Version = (SELECT MAX(Version) FROM Document);
How can I manipulate this statement so as to solve my problem? Help would be greatly appreciated. Thank you in advance! =)
I've already got the SQL statement that looks for that record(document title) which has the highest version number. My problem is, I think it only works for scenarios where there is just one existing document title under a document type. I need an SQL statement that returns the latest version of ALL existing document titles under a document type. Meaning, the latest versions of Analysis_Hardware and Analysis_Software should appear. Please help! =)
This is my SQL statement:
SELECT Doctype, Title, Version, ReleaseDate FROM Document
WHERE Version = (SELECT MAX(Version) FROM Document);
How can I manipulate this statement so as to solve my problem? Help would be greatly appreciated. Thank you in advance! =)