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.
| Author |
Topic |
|
figmo
Starting Member
18 Posts |
Posted - 2011-04-27 : 13:40:21
|
| Table LIBRARY: Title varchar(max) Artist varchar(max) DateAdded smalldatetimeI need to to a SELECT DISTINCT ARTIST FROM LIBRARY, but also need the newest date added to be returned.Artist is not unique. There are many rows with the same artist name. So what I need is a list of all the distinct artist names (only once), but also the newest date added for that artist name.I know this database is not normalized but its a legacy database that I really don't want to start mucking with the structure. So I'm trying to work with what I was given.Is it possible? |
|
|
robvolk
Most Valuable Yak
15732 Posts |
Posted - 2011-04-27 : 14:04:39
|
| SELECT Artist, MAX(DateAdded) FROM LIBRARY GROUP BY Artist |
 |
|
|
|
|
|