Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations GregLocock on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

select distinct max

Status
Not open for further replies.

Guest
I have a table with 3 columns, clientID, salesID and date with data such as
10001,1,5/20/2001
10001,2,5/22/2001
10001,3,5/21/2001
10002,2,5/24/2001
10002,3,5/25/2001
etc
How do I select distinct clientID so that the one selected has the max date? that is, I need the result:
10001,2,5/22/2001
10002,3,5/25/2001
etc
Many thanks
 
Replies continue below

Recommended for you

SELECT DISTINCT clientID, max(date)
FROM Table
GROUP BY clientID
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor