五月综合激情婷婷六月,日韩欧美国产一区不卡,他扒开我内裤强吻我下面视频 ,无套内射无矿码免费看黄,天天躁,日日躁,狠狠躁

新聞動態(tài)

sqlserver清除完全重復(fù)的數(shù)據(jù)只保留重復(fù)數(shù)據(jù)中的第一條

發(fā)布日期:2021-12-28 01:32 | 文章來源:源碼中國
--創(chuàng)建測試表 
CREATE TABLE [dbo].[testtab]( 
[id] [nchar](10) NULL, 
[name] [nchar](10) NULL 
) ; 
--向測試表插入測試數(shù)據(jù) 
insert into testtab values('1','1'); 
insert into testtab values('1','1'); 
insert into testtab values('2','2'); 
insert into testtab values('2','2'); 
insert into testtab values('3','3'); 
insert into testtab values('3','3'); 
--創(chuàng)建臨時表并向臨時表中插入測試表testtab中數(shù)據(jù)以及添加自增id:autoID 
select identity(int,1,1) as autoID, * into #Tmp from testtab 
--根據(jù)autoID刪除臨時表#tmp中的重復(fù)數(shù)據(jù),只保留每組重復(fù)數(shù)據(jù)中的第一條 
delete #Tmp where autoID in(select max(autoID) from #Tmp group by id); 
--清除testtab表中的所有數(shù)據(jù) 
delete testtab; 
--向testtab表中插入#Tmp表中被處理過的數(shù)據(jù) 
insert into testtab select id,name from #Tmp; 
--刪除臨時表#Tmp 
drop table #Tmp;

版權(quán)聲明:本站文章來源標(biāo)注為YINGSOO的內(nèi)容版權(quán)均為本站所有,歡迎引用、轉(zhuǎn)載,請保持原文完整并注明來源及原文鏈接。禁止復(fù)制或仿造本網(wǎng)站,禁止在非maisonbaluchon.cn所屬的服務(wù)器上建立鏡像,否則將依法追究法律責(zé)任。本站部分內(nèi)容來源于網(wǎng)友推薦、互聯(lián)網(wǎng)收集整理而來,僅供學(xué)習(xí)參考,不代表本站立場,如有內(nèi)容涉嫌侵權(quán),請聯(lián)系alex-e#qq.com處理。

實時開通

自選配置、實時開通

免備案

全球線路精選!

全天候客戶服務(wù)

7x24全年不間斷在線

專屬顧問服務(wù)

1對1客戶咨詢顧問

在線
客服

在線客服:7*24小時在線

客服
熱線

400-630-3752
7*24小時客服服務(wù)熱線

關(guān)注
微信

關(guān)注官方微信
頂部