N-Bomb(Nerd) Posted May 29, 2009 Share Posted May 29, 2009 Is there a way I can check to see if there's any repeating values in one of my tables? Quote Link to comment https://forums.phpfreaks.com/topic/160176-checking-my-database/ Share on other sites More sharing options...
Maq Posted May 29, 2009 Share Posted May 29, 2009 Sure, can you post what values you want to check and your table structure? Quote Link to comment https://forums.phpfreaks.com/topic/160176-checking-my-database/#findComment-845111 Share on other sites More sharing options...
N-Bomb(Nerd) Posted May 29, 2009 Author Share Posted May 29, 2009 my table structure: id, i, name Since `i` is unique to each name, I should only have to check `i` to see if there's any repeating of that value. Quote Link to comment https://forums.phpfreaks.com/topic/160176-checking-my-database/#findComment-845116 Share on other sites More sharing options...
Maq Posted May 29, 2009 Share Posted May 29, 2009 Try: SELECT i, COUNT(*) as num FROM table GROUP BY i HAVING num > 1 Quote Link to comment https://forums.phpfreaks.com/topic/160176-checking-my-database/#findComment-845154 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.