title: SQL working select with group by - how to get the id of found records?
body: <p>Following SQL statements brings the needed records out of the database. In addition I would like to get the id's of those "grouped" records. How can I combine this query with another one to get the needed id's?</p>
  
  <p>My table contains facilities with a lat and lng, some of them are at the same location. I get them by querying as following:</p>
  
  <pre><code>SELECT count(*) FROM facilities 
  GROUP BY lat, lng having count(*) &gt; 1
  </code></pre>
  
  <p>How can I get facilities.id of those records?</p>