Table:
SubSection | TradingId | Year | Amount
100A 5001 2004 -120
200B 5001 2005 -130
300C 5002 2006 -140
300C 5003 2007 -150
I want to return the MAX Trading Id based on the subsection, I want this:
SubSection | TradingId | Year | Amount
100A 5001 2004 -120
200B 5001 2005 -130
300C 5003 2007 -150
I tried selecting MAX with a GROUPBY Subsection, tried HAVING MAX etc but no luck
SubSection, TracingIdis unique? – Jack Douglas♦ Jan 6 '12 at 14:59SubSection, TracingIdis unique - if the combination of the two is unique, not if either is unique on its own (which in any case wouldn't tally with your sample data). – Jack Douglas♦ Jan 6 '12 at 17:17