Skip to content

Instantly share code, notes, and snippets.

@aleksb86
Created June 22, 2017 07:11
Show Gist options
  • Save aleksb86/047be09d62d5f8c074a7eedbfc955141 to your computer and use it in GitHub Desktop.
Save aleksb86/047be09d62d5f8c074a7eedbfc955141 to your computer and use it in GitHub Desktop.
Simple duplicate deletion by unique col
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