国产成人精品亚洲777人妖,欧美日韩精品一区视频,最新亚洲国产,国产乱码精品一区二区亚洲

您的位置:首頁技術文章
文章詳情頁

Oracle數據庫刪除表中重復記錄的常見方法

瀏覽:111日期:2023-11-23 09:12:44

方法一:

delete from tb_channel a where a.rowid in

(select max(b.rowid) from tb_channle b

where a.policyno=b.policyno and a.classcode=b.classcode);

——這一辦法在數據記錄超過10萬時一般都會變得很慢。

方法二:

--建立臨時表,--清空原表,--插回原表,如下例:

create table temp_emp as (select distinct * from employee) ;

truncate table employee;

insert into employee select * from temp_emp;

——這一辦法適用于較大的表的情況。因為是塊操作,對應于大表效率會好很多

方法三:

--建立新表,--去重復放入,--刪除原表,如下例:

select distinct * into new_table from old_table

order by 主 鍵

drop table old_table

exec sp_rename new_table,old_table;

——這一辦法適用于較大的表的情況。因為是塊操作,對應于大表效率會好很多

標簽: Oracle 數據庫
主站蜘蛛池模板: 手游| 闵行区| 静宁县| 雷山县| 义乌市| 大埔县| 丰城市| 青海省| 竹北市| 任丘市| 花莲县| 汉阴县| 冷水江市| 彩票| 汉寿县| 加查县| 抚松县| 黄大仙区| 郸城县| 贡觉县| 交城县| 广平县| 潮州市| 宿松县| 忻州市| 高碑店市| 新疆| 潜山县| 积石山| 富蕴县| 佛山市| 深泽县| 潮安县| 云龙县| 东明县| 桑植县| 松溪县| 遂宁市| 武鸣县| 宜城市| 延寿县|