Skip to content

Instantly share code, notes, and snippets.

@nemchik nemchik/jpmc.sql
Created Oct 24, 2018

Embed
What would you like to do?
jpmc sql
UPDATE dwdata.medical_records AS t
INNER JOIN
(
SELECT
DWDOCID, DOCTYPE, MIGRATIONID, COUNT(*) c
FROM dwdata.medical_records
GROUP BY MIGRATIONID
HAVING c > 1
) t1
ON t.DWDOCID = t1.DWDOCID
SET DUP='YES'
WHERE MIGRATIONID IS NOT NULL
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.