MySQL Select duplicates


/ Published in: MySQL
Save to your folder(s)

Instead of the standard return of duplicates, this will actually show the rows that are duplicated, making it easier to see the data


Copy this code and paste it in your HTML
  1. FROM [tablename]
  2. SELECT COUNT( * ) , [columnOfDuplicates]
  3. FROM [tablename]
  4. GROUP BY [columnOfDuplicates]
  5. HAVING COUNT( * ) >1
  6. ) AS t2 ON [tablename].[columnOfDuplicates] = t2.[columnOfDuplicates]

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.