MAX OF Question

MAX OF Question

am 20.12.2007 19:06:30 von laurenq uantrell

I have a table looks like this:

PKID SomeData SomeMoreData IntegerValue
1 Stuff More Stuff 300
2 Cool Very Cool 400
3 Stuff Less Stuff 500

I want to write a GroupBy query that returns the PKID for the row
having the MAX value of IntegerValue grouped by SomeData. I know this
should be simple but can't think of it off hand.

I'm guessing there's a subquery here under PKID?

Any help is appreciated!
lq

Re: MAX OF Question

am 20.12.2007 21:44:22 von Rich P

Try this

select pkID from yourTbl where integervalue = (select max(integervalue)
from yourTbl)


Just change the name of my table to your tablename and then copy this
into a query Sql window and run it.

Rich

*** Sent via Developersdex http://www.developersdex.com ***