 <p>There are many ways to solve it, one is by using a subquery which separately gets the one record for every district. Since you haven't mentioned your RDBMS that you are using, this will work on almost all RDBMS.</p> <pre><code>SELECT a.* FROM tableName a INNER JOIN ( SELECT district, MAX(longitude) max_val FROM tableName GROUP BY district ) b ON a.district = b.district AND a.longitude = max_val </code></pre> <ul> <li><a href="http://www.sqlfiddle.com/#!2/ee2f4/1" rel="nofollow">SQLFiddle Demo</a></li> </ul> <p>OUTPUT</p> <pre><code>╔════════════╦══════════╦═══════════╦══════════╗ ║ RESTAURANT ║ DISTRICT ║ LONGITUDE ║ LATITUDE ║ ╠════════════╬══════════╬═══════════╬══════════╣ ║ perseus ║ 1 ║ 80.879 ║ -56.00 ║ ║ artica ║ 2 ║ 67.708 ║ -69.89 ║ ║ petera ║ 3 ║ 89.00 ║ -78.89 ║ ╚════════════╩══════════╩═══════════╩══════════╝ </code></pre> <p><strong>UPDATE 1</strong></p> <pre><code>WITH recordList AS ( SELECT restaurant, district, longitude, latitude, ROW_NUMBER() OVER (PARTITION BY district ORDER BY longitude DESC) rn FROM TableName ) SELECT restaurant, district, longitude, latitude FROM recordList WHERE rn = 1 </code></pre> <ul> <li><a href="http://www.sqlfiddle.com/#!3/80588/1" rel="nofollow">SQLFiddle Demo</a></li> </ul>