karikamiya Posted February 21, 2011 Share Posted February 21, 2011 K, so i got a table: +---------+----------+ | imageid | tag | +---------+----------+ | 1 | celestia | | 1 | official | | 1 | flying | | 2 | celestia | | 2 | official | | 2 | flying | +---------+----------+ it was going all ok until i noticed there were some duplicates of both rows +---------+----------+ | imageid | tag | +---------+----------+ | 1 | celestia | | 1 | celestia | <<< BAD +---------+----------+ How can i: 1) delete the shown duplicates 2) set the table to not allow a duplicate of both rows to be inserteds im using mysql 5.5.9 [attachment deleted by admin] Quote Link to comment https://forums.phpfreaks.com/topic/228438-confus-with-a-simple-problem/ Share on other sites More sharing options...
karikamiya Posted February 21, 2011 Author Share Posted February 21, 2011 fixed, manually removed the offenders and ran ALTER TABLE `icidtags` ADD UNIQUE (`imageid`, `tag`); Quote Link to comment https://forums.phpfreaks.com/topic/228438-confus-with-a-simple-problem/#findComment-1177958 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.