Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 using Group by

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2001-04-12 : 08:39:07
Dave writes "I think this is a fairly simple SQL question, but it is still driving me nuts!

My database is SQL Server 7 on NT 4, being accessed by ASP

I have a table which stores versions of documents. The relevant columns are:
contentID
version
title
plus other stuff for each document. I need to keep a full version of each document, but I only want to display the most recent (highest numerical value) version number.

I have tried "SELECT max(version), contentID FROM News GROUP BY contentID", but this wont allow me to access fields apart from contentID.

Any help would be gratefully appreciated."
   

- Advertisement -