Created
January 6, 2018 13:39
-
-
Save tihoho/d952c1d18145ee2627b7b92023419390 to your computer and use it in GitHub Desktop.
Remove not-uniuqe values in table field
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
delete from MYTABLE where id in ( | |
select id from ( | |
select id, count(*) 'c' from MYTABLE where 1 group by MYFIELD having count(`c`) > 1 | |
) as `items` | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment