Monday, March 26, 2012

Help with simple(ish) Select query?

Hi

I Have the following table

SequenceNumber___TypeID
8_________________IMG
7_________________IMG
6_________________IMG
5_________________IMG
4_________________IMG
3_________________IMG
2_________________FLP
2_________________IMG


I want to pull the data out in the following format,

SequenceNumber___TypeID
8_________________IMG
2_________________FLP


This basically shows the highest SequenceNumber of each TypeID,

I've tried many different SQL queries but I can't seem to get it! Any ideas?

Thanks

SELECT Max( SequenceNumber ), TypeID
FROM YourTable
GROUP BY TypeID|||Excellent!. I knew it was simpleSmile

No comments:

Post a Comment