Home > database > SQL statement to list duplicate contents

SQL statement to list duplicate contents

You will need this SQL statement to list all duplicate contents in a table

SELECT email,
COUNT(email) AS NumOccurrences
FROM users
GROUP BY email
HAVING ( COUNT(email) > 1 )

source

Categories: database Tags: , , ,
  1. No comments yet.
  1. No trackbacks yet.