Skip to content

Instantly share code, notes, and snippets.

@jinseokoh
Created October 17, 2017 10:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jinseokoh/e1f22bc1d1af168a43689558fb4e40e0 to your computer and use it in GitHub Desktop.
Save jinseokoh/e1f22bc1d1af168a43689558fb4e40e0 to your computer and use it in GitHub Desktop.
sql query
select m.delivery_id, m.order_id, m.activated, dups.cnt from delivery_vroong_order_map as m
inner join (
select delivery_id, COUNT(*) as cnt
from delivery_vroong_order_map
group by delivery_id
having
count(*) > 1
) dups on m.delivery_id = dups.delivery_id;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment