查询数据
查询姓名相同的用户的数量和姓名:
Select count(*) ,username from userinfo
Group By username
Having count(*) >1
查询结果如下:
COUNT(*) USERNAME
4 许明
2 刘起龙
17 飞龙剑
删除相同数据
Delete from userinfo Group By username Having count(*) > 1