Created
June 22, 2017 07:11
-
-
Save aleksb86/047be09d62d5f8c074a7eedbfc955141 to your computer and use it in GitHub Desktop.
Simple duplicate deletion by unique col
This file contains 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
delete from reg.cropio_export exp | |
where exp.obj in ('machine', 'trailer') | |
and exp.objectid not in ( | |
select max(objectid) as objectid | |
from reg.cropio_export | |
where obj in ('machine', 'trailer') | |
group by obj, uid | |
) | |
; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment