I'm an SQL beginner and this is driving me nuts as it seems simple enough
but I can't figure it out.
I have a table that looks like:
ID: int
MajorVersion: int
MinorVersion: int
Content: ntext
The ID is not the table key - different rows can have the same ID.
The MajorVersion and MinorVersion columns together make up a version number.
Say if a row represented version 1.8 of that ID, MajorVersion would be 1 and
MinorVersion 8.
All I want to do is query for ID and Content for the highest versions of
each ID. I tried using GROUP BY but I can't do that because I can't include
Content in the SELECT then.
Am I going to have to just query for the ID and then do a join to get the
Content?
Thanks for any help
Chris
but I can't figure it out.
I have a table that looks like:
ID: int
MajorVersion: int
MinorVersion: int
Content: ntext
The ID is not the table key - different rows can have the same ID.
The MajorVersion and MinorVersion columns together make up a version number.
Say if a row represented version 1.8 of that ID, MajorVersion would be 1 and
MinorVersion 8.
All I want to do is query for ID and Content for the highest versions of
each ID. I tried using GROUP BY but I can't do that because I can't include
Content in the SELECT then.
Am I going to have to just query for the ID and then do a join to get the
Content?
Thanks for any help
Chris
Comment