Posted By

TheNullByte on 06/13/12


Tagged

mysql select duplicate dup


Versions (?)

MySQL Select duplicates


 / Published in: MySQL
 

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

  1. SELECT *
  2. FROM [tablename]
  3. INNER JOIN (
  4. SELECT COUNT( * ) , [columnOfDuplicates]
  5. FROM [tablename]
  6. GROUP BY [columnOfDuplicates]
  7. HAVING COUNT( * ) >1
  8. ) AS t2 ON [tablename].[columnOfDuplicates] = t2.[columnOfDuplicates]

Report this snippet  

You need to login to post a comment.