Created
November 13, 2017 15:19
-
-
Save zazk/e2f5f4ad2d42f3eb321de440818f5475 to your computer and use it in GitHub Desktop.
Temporary Table set value.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| CREATE TEMPORARY TABLE IF NOT EXISTS duplicates AS (SELECT mto.id | |
| FROM talleres mto | |
| WHERE EXISTS | |
| ( | |
| SELECT 1 | |
| FROM talleres mti | |
| WHERE mti.latitud = mto.latitud and mti.longitud = mto.longitud | |
| LIMIT 1, 1 | |
| ) | |
| order by id ); | |
| update talleres set duplicate = 1 WHERE id IN ( select id from duplicates ); | |
| select id, latitud, longitud, duplicate from talleres where duplicate = 1; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment