Skip to content

Instantly share code, notes, and snippets.

@Dillie-O
Created September 11, 2012 16:58
Show Gist options
  • Save Dillie-O/3699824 to your computer and use it in GitHub Desktop.
Save Dillie-O/3699824 to your computer and use it in GitHub Desktop.
Advanced Duplicate Row Query in SQL
SELECT COUNT(*) as duplicate_count,
application_id,
lock_version,
asset_id,
customer_id,
received_date,
fee_amount,
created_at,
updated_at
FROM application_versions
GROUP BY application_id,
lock_version,
asset_id,
customer_id,
received_date,
fee_amount,
created_at,
updated_at
HAVING COUNT(*) > 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment