Where 2 columns match, select highest sequence number?

  • Thread starter Thread starter John
  • Start date Start date
J

John

I want to build a SQL statement that only returns the last row of data
(defined by "SEQ") if the ID and DATE match. Here is my sample data:

ID DATE SEQ
1 2008 0
1 2008 1
1 2008 2
2 2007 0
3 2008 0
3 2008 1

I want to return the highest SEQ number only:

ID DATE SEQ
1 2008 2
2 2007 0
3 2008 1
 
Back
Top