没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
select distinct Dept_Arvl from com_3
delete from 表 where id not in
(select max(id) from 表 group by mobilePhone,officePhone,email )
查询重复的行
select hospital_name,hospital_address from gz_hospital group by hospital_name,hospital_address having count(hospital_name)>1
1.delete from users a where a.user_id = (select max(b.user_id) from users b where a.user_name=b.user_name);
这一种自联接,效率低一点.
2.delete from users where user_id not in(select max(user_id) from users group by user_name having count(user_name)>=1);
这一种先分组,效率高一些.
在此作下符号,希望对同行的朋友们有所启示.
sql去重复的行
情形一
(已验证)
DB:SQL SERVER
行的数据完全重复
采用下面的步骤可清除重复的数据,只保留一行
delete from 表 where id not in
(select max(id) from 表 group by mobilePhone,officePhone,email )
查询重复的行
select hospital_name,hospital_address from gz_hospital group by hospital_name,hospital_address having count(hospital_name)>1
1.delete from users a where a.user_id = (select max(b.user_id) from users b where a.user_name=b.user_name);
这一种自联接,效率低一点.
2.delete from users where user_id not in(select max(user_id) from users group by user_name having count(user_name)>=1);
这一种先分组,效率高一些.
在此作下符号,希望对同行的朋友们有所启示.
sql去重复的行
情形一
(已验证)
DB:SQL SERVER
行的数据完全重复
采用下面的步骤可清除重复的数据,只保留一行






资源评论

shizhou168
- 粉丝: 0
- 资源: 20

上传资源 快速赚钱
我的内容管理 展开
我的资源 快来上传第一个资源
我的收益
登录查看自己的收益我的积分 登录查看自己的积分
我的C币 登录后查看C币余额
我的收藏
已下载
下载帮助

看过该资源的人还看了
安全验证
文档复制为VIP权益,开通VIP直接复制
