select * from menus where parentid = 300 group by menuname having count(id)>1;
查询表里某个字段有重复值
本文介绍了一种使用SQL查询来找出数据库表中具有重复值的方法。通过一个具体的例子展示了如何利用GROUP BY和HAVING子句来筛选出特定字段值重复的记录。
select * from menus where parentid = 300 group by menuname having count(id)>1;
查询表里某个字段有重复值

被折叠的 条评论
为什么被折叠?