Skip to content

Instantly share code, notes, and snippets.

@tallesairan
Created December 28, 2019 15:37
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 tallesairan/45e1adcb9194bd5ba95aa7bd3e9f4e80 to your computer and use it in GitHub Desktop.
Save tallesairan/45e1adcb9194bd5ba95aa7bd3e9f4e80 to your computer and use it in GitHub Desktop.
find duplicate records mysql
SELECT
userId,
COUNT(userId)
FROM
payments
WHERE transactionStatus = 'approved'
GROUP BY userId
HAVING COUNT(userId) > 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment