Skip to content

Instantly share code, notes, and snippets.

@zazk
Created November 13, 2017 15:19
Show Gist options
  • Select an option

  • Save zazk/e2f5f4ad2d42f3eb321de440818f5475 to your computer and use it in GitHub Desktop.

Select an option

Save zazk/e2f5f4ad2d42f3eb321de440818f5475 to your computer and use it in GitHub Desktop.
Temporary Table set value.
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