Last active
March 23, 2019 09:32
-
-
Save sintret/a44225567ee6d4ed880a500ccda2e0c6 to your computer and use it in GitHub Desktop.
mysql find duplicate
This file contains hidden or 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
| SELECT a.phone, b.phone, a.companyId , b.companyId , a.id,b.id | |
| FROM member a, member b | |
| WHERE a.phone = b.phone | |
| AND a.companyId = b.companyId | |
| AND a.id <> b.id | |
| SELECT phone, COUNT(*) c FROM member GROUP BY phone HAVING c > 1; | |
| SELECT GROUP_CONCAT(companyId), phone, COUNT(*) c FROM member GROUP BY phone HAVING c > 1; | |
| INSERT INTO mytable (uid,`session`,counting,`type`,ft,isFilter ) SELECT uid,`session`,counting,`type`,ft,isFilter FROM mytableother WHERE id = 1 | |
| for mysql 8 | |
| login as root | |
| ALTER USER 'myuser'@'localhost' IDENTIFIED WITH mysql_native_password BY 'my password'; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment