By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,121 Members | 1,706 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,121 IT Pros & Developers. It's quick & easy.

MAX OF Question

P: n/a
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!

Dec 20 '07 #1
Share this Question
Share on Google+
1 Reply

P: n/a
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.


*** Sent via Developersdex ***
Dec 20 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.