oracle刪除重複行

2021-06-12 10:16:49 字數 391 閱讀 7452

--oracle刪除重複行,一定是設定主鍵才能用

delete from sys_role_function a

where exists(

select * from sys_role_function

where srfu_id

--oracle刪除重複行,可以不用主鍵,推薦使用

delete from sys_role_function a where rowid<>(

select max(rowid) from sys_role_function  where srfu_id=a.srfu_id and srfu_sfun_id = a.srfu_sfun_id and srfu_srol_id = a.srfu_srol_id

)

oracle刪除重複行的方法

刪除重複行有兩種方法 資料準備 建表語句 create table a a varchar2 10 b varchar2 20 插入資料 insert into a values 11 22 insert into a values 11 22 insert into a values 11 22 ...

刪除多餘 重複的行 oracle

有些表在設計時沒有加約束條件,雖然有序列號,但是內容有很多重複的資料,比如 id 姓 名 1.朱 亮 2.朱 亮 3.王 小丫 4.張 三 declare p exists number 0 begin select count into p exists from user tables wher...

Linux刪除重複行

文字處理時,經常要刪除重複行,下面是三種方法 第一,用sort uniq,注意,單純uniq是不行的。sort n test.txt uniq 第二,用sort awk命令,注意,單純awk同樣不行,原因同上。sort n file awk 第三,用sort sed命令,同樣需要sort命令先排序。...