Finding duplicates in a MYSQL table select name, count(name) as cnt from term_data group by name having cnt > 1 order by cnt;