acidglitter Posted May 18, 2008 Share Posted May 18, 2008 this is probably really simple but i can't seem to figure out how to do this. i'm trying to switch primary keys and get rid of duplicate rows in one of my tables. whats an easy way to do this? i tried something like this.. SELECT id FROM members WHERE COUNT('id') > 1 but that didn't want to work.. Link to comment https://forums.phpfreaks.com/topic/106223-solved-mysql-count-help-and-duplicate-rows/ Share on other sites More sharing options...
Barand Posted May 18, 2008 Share Posted May 18, 2008 SELECT id, COUNT(*) as total FROM members GROUP BY id HAVING total > 1 ORDER BY total DESC Link to comment https://forums.phpfreaks.com/topic/106223-solved-mysql-count-help-and-duplicate-rows/#findComment-544475 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.