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)
 Select Last for each user

Author  Topic 

plocke
Starting Member

15 Posts

Posted - 2001-06-02 : 01:41:56
Say a table has multiple client records.
I want to get the latest record for each
distinct client.
How?

SELECT client_id, client_id, date_created
from client_records

but don't want all the rows i want the Max(date_created) row for each.

instead of
joe, 1, 12/21/01
joe,1, 4/02/01
sam,2, 3/25/00
sam,2, 7/23/00
sam,2, 1/25/01

Id get
joe, 1, 12/21/01
sam,2, 1/25/01


HOw?


   

- Advertisement -