Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need max value 1

Status
Not open for further replies.

lanm

Programmer
Joined
Jul 7, 2005
Messages
244
Location
US
I have two colums, WPID and WNum. WPID is distinct, but WNum can be reapeated.
For instance, I could have WPID 1-10, and each value for WNum would be 55555. What I need to do is get the maximum value for WPID associated to WNum, in this case 10.....and spin through all the records this way.

I've tried (and other ways):
SELECT MAX(WPID) AS Expr1, [WNum]
FROM WP_General_Info
GROUP BY [WNum], WPID

...but it's not working.
 
Try

Code:
SELECT WNum, MAX(WPID) AS Expr1
FROM WP_General_Info
GROUP BY WNum
 
Right on! Thanks Juice05! That was it!
 
No problem. You had the right idea, just backwards.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top