· 8 years ago · Nov 15, 2017, 02:02 PM
1CREATE TEMPORARY TABLE IF NOT EXISTS duplicates AS (SELECT mto.id
2FROM talleres mto
3WHERE EXISTS
4 (
5 SELECT 1
6 FROM talleres mti
7 WHERE mti.latitud = mto.latitud and mti.longitud = mto.longitud
8 LIMIT 1, 1
9 )
10order by id );
11
12update talleres set duplicate = 1 WHERE id IN ( select id from duplicates );
13
14select id, latitud, longitud, duplicate from talleres where duplicate = 1;