微软BI开拓者数据仓库专区SSIS使用与管理 如何在表中重复信息的筛选和抽取(高手指导)--在线等

1  /  1  页   1 跳转 查看:2732

如何在表中重复信息的筛选和抽取(高手指导)--在线等

如何在表中重复信息的筛选和抽取(高手指导)--在线等

现在在一张表中的一个字段有重复数据的现象
如果我用IS进行转换,我想只取重复数据其中的一条.其他重复的数据我需要导如另一张临时表里面.请高手知道.
最后编辑Administrator 最后编辑于 2008-01-25 10:51:03
 

回复: 如何在表中重复信息的筛选和抽取(高手指导)--在线等

直接使用SQL呢?
select *, 1 as [rank] into duplicated from table1 where 1 = 2;
with
tmp as
(select *, row_number()over(partition by id order by id) as [rank] from table1)
delete
from tmp
output deleted.* into duplicated
where [rank] > 1
 
1  /  1  页   1 跳转

版权所有 微软BI开拓者 

Powered by Discuz!NT 2.1.202    Copyright © 2001-2012 Comsenz Inc.
Processed in 0.0312512 second(s) , 4 queries.
返顶部