Where 2 columns match, select highest sequence number?

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top