例如表名为Course
需要查询出name重复的有那些???
解答如下:
补充:
如:查询每个姓名出现大于2次,SQL如下
SELECT COUNT(NAME) as '出现次数', NAME FROM 表名
GROUP BY NAME HAVING count(NAME) > 2 ORDER BY 出现次数 DESC
例如表名为Course
需要查询出name重复的有那些???
解答如下:
补充:
如:查询每个姓名出现大于2次,SQL如下
SELECT COUNT(NAME) as '出现次数', NAME FROM 表名
GROUP BY NAME HAVING count(NAME) > 2 ORDER BY 出现次数 DESC