I hope I can get some help on this. This is by far my weakest area in creating databases.
Queries:
I need a query that allows me to find the highest number in a field for each set in that table.
IE: I have a master table of classes, and a linked table (one to many) of revisions / versions of that specific class. I want to return ONLY THE MOST RECENT version of each class. I know how to show the top 1 return (showing descending order on version field), but that only returns the HIGHEST version for any ONE class. Any class that has only a single revision, or revisions lesser than the greatest will not be shown.
Anyway to be able to do this?
My idea at the moment is somthing along the lines of a query within a query, but i'm stumped at the moment on how to accomplish this.
Something like:
SELECT ClassTable.Classes, (Select TOP 1 VersionsTable.ClassVersion FROM VersionTable Order By VersionTable.ClassVersion DESC
AS VersionList FROM ClassTable;
This query returns all the classes, but only the highest version of one specific class for ALL classes. (IE: Class1 has 6 revisions, 2 and 3 only have 2 Revisions, but Class 1, 2, and 3 all show that Revision 6 is the latest revisions for all 3 classes, where they should be returning 6 revisions for class1, and 2 revisions for classes 2 and 3.)
Any help would be great
Kelemit
Queries:
I need a query that allows me to find the highest number in a field for each set in that table.
IE: I have a master table of classes, and a linked table (one to many) of revisions / versions of that specific class. I want to return ONLY THE MOST RECENT version of each class. I know how to show the top 1 return (showing descending order on version field), but that only returns the HIGHEST version for any ONE class. Any class that has only a single revision, or revisions lesser than the greatest will not be shown.
Anyway to be able to do this?
My idea at the moment is somthing along the lines of a query within a query, but i'm stumped at the moment on how to accomplish this.
Something like:
SELECT ClassTable.Classes, (Select TOP 1 VersionsTable.ClassVersion FROM VersionTable Order By VersionTable.ClassVersion DESC

This query returns all the classes, but only the highest version of one specific class for ALL classes. (IE: Class1 has 6 revisions, 2 and 3 only have 2 Revisions, but Class 1, 2, and 3 all show that Revision 6 is the latest revisions for all 3 classes, where they should be returning 6 revisions for class1, and 2 revisions for classes 2 and 3.)
Any help would be great
Kelemit