資料庫刪除重覆記錄

2021-04-16 05:24:53 字數 563 閱讀 1614

刪除重覆記錄:

sql> delete from wzh_questions a where a.rowid!=(select max(rowid) from lunar b where a.shuaho=b.shuhao and a.tihao=b.tihao);

整理insert語句

select 'insert into wzh_questions150 values('||chr(39)||xuhao||chr(39)||','||chr(39)||shuhao||chr(39)||','||chr(39)||tihao||chr(39)||','||chr(39)||wenti||chr(39)||','||chr(39)||xz1||chr(39)||','||chr(39)||xz2||chr(39)||','||chr(39)||xz3||chr(39)||','||chr(39)||xz4||chr(39)||','||chr(39)||zqxz||chr(39)||','||chr(39)||ywlt||chr(39)||','||chr(39)||ltmc||chr(39)||');' from  wzh_questions100

刪除重覆記錄

我們經常在資料庫中有重複的記錄這時候我們希望刪除那些重複的記錄 你不要告訴我你是一條條手動刪除的哈 select distinct into newtable form 程式設計客棧nbsp tablename drop table tabwww.cppcns.comlename select in...

SQL查詢重覆記錄,刪除重覆記錄

1 查詢表中多餘的重覆記錄,重覆記錄是根據單個字段 docid 來判斷 select from tablename where docid in select docid from tablename group by docid h ing count docid 1 例二 select from...

Oracle刪除重覆記錄

oracle刪除重覆記錄的最好的方法 delete from emp e where e.rowid select min y.rowid from emp y where y.empno e.empno 1 子查詢找出某員工最低的rowid 肯定只有乙個 其它大於這條記錄rowid的,全部刪除。2...