转:SQL重复记录查询


select distinct * into #Temp from RepeatAll
drop table RepeatAll
select * into RepeatAll from #Temp
drop table #Temp

select identity(int,1,1) id,* into #Temp from RepeatAll
drop table RepeatAll
--select
select name,sex,address from #Temp group by name,sex,address having (count(*)>1)
--delete
delete from #Temp where id not in
(select min(id) id from #Temp group by name,sex,address)
select name,sex,address into RepeatAll from #Temp
drop table #Temp

优质内容筛选与推荐>>
1、为SharePoint 2013配置Office Web Apps
2、事务
3、用Quick Cocos2dx做一个连连看(三)
4、[转载]深入理解java多态性
5、剑指offer第二版-4.二维数组中的查找


长按二维码向我转账

受苹果公司新规定影响,微信 iOS 版的赞赏功能被关闭,可通过二维码转账支持公众号。

    阅读
    好看
    已推荐到看一看
    你的朋友可以在“发现”-“看一看”看到你认为好看的文章。
    已取消,“好看”想法已同步删除
    已推荐到看一看 和朋友分享想法
    最多200字,当前共 发送

    已发送

    朋友将在看一看看到

    确定
    分享你的想法...
    取消

    分享想法到看一看

    确定
    最多200字,当前共

    发送中

    网络异常,请稍后重试

    微信扫一扫
    关注该公众号