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

DB2刪除重復(fù)數(shù)據(jù)的實(shí)現(xiàn)

數(shù)據(jù)庫
如果DB2數(shù)據(jù)庫中出現(xiàn)重復(fù)數(shù)據(jù),應(yīng)該如何刪除呢?下面就教您一個刪除DB2重復(fù)數(shù)據(jù)庫的實(shí)現(xiàn)方法,供您參考。

DB2刪除重復(fù)數(shù)據(jù)使我們經(jīng)常使用的操作,下面就教您DB2刪除重復(fù)數(shù)據(jù)的方法,希望可以對您學(xué)習(xí)DB2刪除重復(fù)數(shù)據(jù)方面有所幫助。

使用ROW_NUMBER 刪除重復(fù)數(shù)據(jù)
假設(shè)表TAB中有a,b,c三列,可以使用下列語句刪除a,b,c都相同的重復(fù)行。

  1. delete from (select * from (select a,b,c,row_number() over(partition by a,b,c order by a,b,c) as row_num from tab) as e where row_num >1) 

如果數(shù)據(jù)量太大可以采用如下方法:

  1. Create table emp_profile_temp like emp_profile; 

大數(shù)據(jù)量采用 LOAD FROM CURSUR

  1. DECLARE mycursor CURSOR FOR SELECT distinct * FROM emp_profile;  
  2. LOAD FROM mycursor OF CURSOR INSERT INTO emp_profile_temp; 
  1. drop table emp_profile;  
  2. rename table emp_profile_temp to emp_profile  

 

 

 

【編輯推薦】

DB2公共表表達(dá)式的用法

跨數(shù)據(jù)庫訪問DB2表的方法

DB2表空間大小的限制

Lotus Notes調(diào)用DB2存儲過程

DB2連接服務(wù)器的配置

 

責(zé)任編輯:段燃 來源: 互聯(lián)網(wǎng)
相關(guān)推薦

2015-10-23 16:40:21

DB2刪除數(shù)據(jù)

2010-09-30 10:29:56

DB2刪除重復(fù)記錄

2010-11-03 15:49:32

DB2刪除表

2010-08-03 09:49:58

DB2恢復(fù)數(shù)據(jù)庫

2010-07-07 16:53:54

SQL Server重

2010-07-21 11:38:59

SQL Server重

2010-07-26 14:58:26

SQL Server刪

2010-11-04 14:39:44

DB2刪除數(shù)據(jù)

2010-11-03 11:49:15

刪除DB2數(shù)據(jù)

2010-07-26 09:55:55

SQL Server重

2010-11-03 16:32:10

DB2創(chuàng)建數(shù)據(jù)庫

2010-08-13 17:54:14

DB2 dart恢復(fù)數(shù)

2010-07-23 15:09:42

SQL Server刪

2011-04-13 13:05:14

重復(fù)數(shù)據(jù)刪除

2010-07-23 16:21:37

SQL Server重

2010-09-30 15:52:55

DB2循環(huán)查詢

2010-09-30 16:21:40

DB2隔離級別

2010-11-03 14:52:26

DB2列轉(zhuǎn)行

2010-08-11 09:14:33

DB2數(shù)據(jù)類型

2011-04-13 13:13:09

重復(fù)數(shù)據(jù)刪除
點(diǎn)贊
收藏

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