Jump to content

Number of identical entries in MySQL DB column


PTS

Recommended Posts

SELECT column, count(*) FROM table GROUP BY column ORDER BY count(*) DESC

 

The ordering is optional of course, but that's usually the order you want.  You can also add "HAVING count(*) > 1" if you want to display only values which appear more than once.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.