主頁(yè) > 知識(shí)庫(kù) > sql2000數(shù)據(jù)庫(kù)清除重復(fù)數(shù)據(jù)的二種方法

sql2000數(shù)據(jù)庫(kù)清除重復(fù)數(shù)據(jù)的二種方法

熱門標(biāo)簽:Linux服務(wù)器 服務(wù)外包 呼叫中心市場(chǎng)需求 鐵路電話系統(tǒng) AI電銷 地方門戶網(wǎng)站 百度競(jìng)價(jià)排名 網(wǎng)站排名優(yōu)化

使用游標(biāo)實(shí)現(xiàn)

復(fù)制代碼 代碼如下:

declare @id1 int,@oldid int,@e_REcordid int ,@Olde_REcordid int
DECLARE price CURSOR
FOR SELECT id ,E_recordId FROM evaeve order by  E_recordId desc
OPEN price
FETCH NEXT FROM price  into @oldid,@Olde_REcordid
while @@fetch_status  = 0
begin
FETCH NEXT FROM price  
into @id1,@e_REcordid

if @Olde_REcordid=@e_REcordid
BEGIN
  delete from evaeve where id=@id1
end
set @oldid=@id1
set @Olde_REcordid=@e_REcordid
end 
close price
DEALLOCATE price

使用sql語(yǔ)句實(shí)現(xiàn)

復(fù)制代碼 代碼如下:

delete   from evaeve where id not in(  select max(id)  from evaeve group by   E_RecordID)

您可能感興趣的文章:
  • 刪除mysql數(shù)據(jù)庫(kù)中的重復(fù)數(shù)據(jù)記錄
  • 教你幾種在SQLServer中刪除重復(fù)數(shù)據(jù)方法
  • sqlserver中重復(fù)數(shù)據(jù)值只取一條的sql語(yǔ)句
  • SQL語(yǔ)句刪除2條重復(fù)數(shù)據(jù)一條保留一條
  • sql刪除重復(fù)數(shù)據(jù)的詳細(xì)方法
  • SQL Server中刪除重復(fù)數(shù)據(jù)的幾個(gè)方法
  • 分享MYSQL插入數(shù)據(jù)時(shí)忽略重復(fù)數(shù)據(jù)的方法
  • MYSQL刪除重復(fù)數(shù)據(jù)的簡(jiǎn)單方法
  • MySQL 刪除數(shù)據(jù)庫(kù)中重復(fù)數(shù)據(jù)方法小結(jié)
  • sqlserver清除完全重復(fù)的數(shù)據(jù)只保留重復(fù)數(shù)據(jù)中的第一條
  • Sql Server使用cursor處理重復(fù)數(shù)據(jù)過(guò)程詳解
  • 刪除MySQL重復(fù)數(shù)據(jù)的方法
  • MySQL中刪除重復(fù)數(shù)據(jù)的簡(jiǎn)單方法
  • SQL Server數(shù)據(jù)庫(kù)刪除數(shù)據(jù)集中重復(fù)數(shù)據(jù)實(shí)例講解

標(biāo)簽:黃山 銅川 衡水 仙桃 蘭州 湘潭 湖南 崇左

巨人網(wǎng)絡(luò)通訊聲明:本文標(biāo)題《sql2000數(shù)據(jù)庫(kù)清除重復(fù)數(shù)據(jù)的二種方法》,本文關(guān)鍵詞  ;如發(fā)現(xiàn)本文內(nèi)容存在版權(quán)問(wèn)題,煩請(qǐng)?zhí)峁┫嚓P(guān)信息告之我們,我們將及時(shí)溝通與處理。本站內(nèi)容系統(tǒng)采集于網(wǎng)絡(luò),涉及言論、版權(quán)與本站無(wú)關(guān)。
  • 相關(guān)文章
  • 收縮
    • 微信客服
    • 微信二維碼
    • 電話咨詢

    • 400-1100-266