Tables with fields id , lat , lng

  • lat - latitude, geographic coordinate
  • lng - longitude, geographic coordinate

Each line of the table contains a point on the map.

It is necessary to display groups of points with the same coordinates, with the number of points in the group at least 10.

  • one
    [Having] [1] should help you [1]: sql-tutorial.ru/en/book/having_clause.html - DreamChild
  • An example can be seen? Otherwise - a bunch of leading questions. - alexlz
  • Group the data by coordinates (GROUP BY), and then select groups with at least 10 points in the group (HAVING). - Alexander Serebrenik

1 answer 1

You can do the following:

 SELECT lat, lng, COUNT(id) AS total FROM coords GROUP BY lat, lng HAVING total > 10