How to retrieve the rows (with maximum value in a field) having a another common field ?

Posted by Ashraf Bashir on Stack Overflow See other posts from Stack Overflow or by Ashraf Bashir
Published on 2010-04-30T17:09:24Z Indexed on 2010/04/30 17:17 UTC
Read the original article Hit count: 253

Filed under:
|
|
|
|

I have a table; let it be called table1; with the following fields and data

alt text

I need a query that returns the record with the maximum value in Field3 for each group of records having the same value in Field2. So that the query returns:

alt text

How could this be done using SQL queries ?

© Stack Overflow or respective owner

Related posts about sql

Related posts about sql-server-2005