首页 > 学院 > 开发设计 > 正文

SQL查询语句

2019-11-08 20:58:55
字体:
来源:转载
供稿:网友
查询student表中手机号重复数据select id,uid,mobile,count(*) as count from student group by mobile having count>1; 查询student表中id最小的重复数据select max(id) from student group by uid having count(uid) > 1删除student表中重复的id最小的数据delete from student where id in (select minid from (select min(id) as minid from student group by mobile having count(mobile) > 1) as b);
发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表