2019独角兽企业重金招聘Python工程师标准>>>
表数据如下:
查询表中重复的数据:
SELECT * FROM t_class WHERE classname IN (SELECT classname FROM t_class GROUP BY classname HAVING COUNT(classname) > 1)
结果如下:
显示出来的数据,没有重复的数据:
SELECT classname FROM t_class GROUP BY classname HAVING COUNT(classname) >= 1