自拍偷在线精品自拍偷,亚洲欧美中文日韩v在线观看不卡

Oracle數(shù)據(jù)庫刪除表中重復(fù)記錄的方法三則

數(shù)據(jù)庫 Oracle
oracle數(shù)據(jù)庫是一種大型數(shù)據(jù)庫系統(tǒng),應(yīng)用比較廣泛,很多網(wǎng)站都在用Oracle數(shù)據(jù)庫,下面為大家介紹Oracle數(shù)據(jù)庫刪除表中重復(fù)記錄的常見方法。

導(dǎo)讀:Oracle數(shù)據(jù)庫在操作中,難免會(huì)有很多重復(fù)記錄,這些重復(fù)記錄都是些沒有用的數(shù)據(jù),所以就可以放心的刪除,那么久介紹一些Oracle數(shù)據(jù)庫刪除表中重復(fù)記錄的常見方法。

方法一:

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);

——這一辦法在數(shù)據(jù)記錄超過10萬時(shí)一般都會(huì)變得很慢。

方法二:

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

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

truncate table employee;

insert into employee select * from temp_emp;

——這一辦法適用于較大的表的情況。因?yàn)槭菈K操作,對應(yīng)于大表效率會(huì)好很多

方法三:

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

select distinct * into new_table from old_table

order by 主 鍵

drop table old_table

exec sp_rename new_table,old_table;

——這一辦法適用于較大的表的情況。因?yàn)槭菈K操作,對應(yīng)于大表效率會(huì)好很多

以上者三種方法,對表的數(shù)數(shù)額是不同的,所以可以根據(jù)具體的情況靈活應(yīng)用,不論使用哪個(gè),只要自己用著方便快捷就好。

【編輯推薦】

  1. 重裝系統(tǒng)后ORACLE數(shù)據(jù)庫恢復(fù)的方法
  2. 怎么管理好Oracle數(shù)據(jù)庫
  3. Oracle數(shù)據(jù)庫系統(tǒng)使用經(jīng)驗(yàn)
責(zé)任編輯:迎迎 來源: 比特網(wǎng)
相關(guān)推薦

2011-05-17 11:23:02

Oracle數(shù)據(jù)庫

2010-04-13 10:23:40

Oracle數(shù)據(jù)庫

2010-10-27 16:49:23

Oracle刪除重復(fù)記

2010-10-13 17:07:46

MySQL刪除重復(fù)記錄

2011-03-29 09:26:35

Oracle數(shù)據(jù)庫

2011-05-24 10:04:39

Oracle重復(fù)記錄

2018-09-11 17:13:23

MySQ數(shù)據(jù)庫重復(fù)記錄

2010-11-23 14:26:02

MySQL刪除重復(fù)記錄

2010-10-27 16:56:05

Oracle重復(fù)記錄

2010-11-15 14:42:03

Oracle查詢重復(fù)記

2010-04-13 10:15:17

Oracle數(shù)據(jù)庫

2010-07-02 13:50:11

SQL Server數(shù)

2010-04-28 18:25:51

Oracle數(shù)據(jù)庫

2011-03-14 15:47:33

Oracle數(shù)據(jù)庫

2011-05-24 14:13:20

Oracle數(shù)據(jù)庫

2010-10-13 17:13:17

MySQL重復(fù)記錄

2010-11-25 15:43:02

MYSQL查詢重復(fù)記錄

2011-03-21 17:25:08

SQL Server數(shù)重復(fù)記錄

2010-09-03 09:49:39

SQL刪除

2010-09-25 16:17:25

SQL語句
點(diǎn)贊
收藏

51CTO技術(shù)棧公眾號