November 17, 2004 at 10:57 pm
Hi
I'm having some difficulties to query a table for some values. Here i go..
I have 3 colums
col1 col2 col3
0 0 0
0 1 0
0 2 2
1 0 0
1 1 2
1 2 3
Basically i want to obtain the result for the max value of col3 based on col 1 ie
col1 col3
0 2
1 3
Is there any query that i can use to get this?
Thanks a lot
November 18, 2004 at 12:03 am
Select col1, max(col3) as MaxCol3 from tbl group by col1
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
November 18, 2004 at 1:09 am
Hi
Thanks a lot you have saved me a lot of trouble..
appreciate your help
Cheers
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply