Hello, Everyone.
This should be pretty easy.
I am trying to select only the records with the maximum date from a table. Evidently, I do not clearly understand how the MAX() function actually works.
I am using this unsuccessful query:
The data set would look like
1,111-11-1111,01/01/2008
2,111-11-1111,01/01/2010
3,111-11-1234,01/01/2009
4,111-11-1234,01/01/2007
I only want to see
2,111-11-1111,01/01/2010
3,111-11-1234,01/01/2009
because they are the Ssn with the largest date.
Thanks, Everyone
Patrick
This should be pretty easy.
I am trying to select only the records with the maximum date from a table. Evidently, I do not clearly understand how the MAX() function actually works.
I am using this unsuccessful query:
Code:
SELECT My_ID,Ssn,Max(My_Date)
FROM My_Table
GROUP BY Ssn,My_ID
ORDER BY Ssn
The data set would look like
1,111-11-1111,01/01/2008
2,111-11-1111,01/01/2010
3,111-11-1234,01/01/2009
4,111-11-1234,01/01/2007
I only want to see
2,111-11-1111,01/01/2010
3,111-11-1234,01/01/2009
because they are the Ssn with the largest date.
Thanks, Everyone
Patrick