MySQL 查询某个字段重复的数据
- 爵特猛
- 2023-6-29 16:32
- 其它
- 1901
SELECT * FROM `user` WHERE `name` IN (SELECT `name` FROM `user` GROUP BY `name` HAVING COUNT(`name`)>1) ORDER BY `name` ASC,`id` ASC
本文为爵特猛原创文章,转载无需和我联系,但请注明来自爵特猛博客www.juetemeng.com
SELECT * FROM `user` WHERE `name` IN (SELECT `name` FROM `user` GROUP BY `name` HAVING COUNT(`name`)>1) ORDER BY `name` ASC,`id` ASC
爵特猛