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

DB2實(shí)現(xiàn)Oracle數(shù)據(jù)庫(kù)的功能與技巧描述

數(shù)據(jù)庫(kù)
我們今天主要向大家講述的是DB2實(shí)現(xiàn)Oracle數(shù)據(jù)庫(kù)的相關(guān)功能以及在實(shí)際操作中的經(jīng)驗(yàn)總結(jié),以下就是文章的主要內(nèi)容的詳細(xì)解析。

以下的文章主要向大家講述的是DB2實(shí)現(xiàn)Oracle數(shù)據(jù)庫(kù)的相關(guān)功能以及在實(shí)際操作中的經(jīng)驗(yàn)總結(jié),此文中我主要是與大家一同分享了一些自己遇到的在DB2中實(shí)現(xiàn)Oracle某些功能的技巧與心得……

 

在現(xiàn)實(shí)的應(yīng)用中大家可能經(jīng)常會(huì)遇到在DB2中如何實(shí)現(xiàn)Oracle的某些功能﹐在此我簡(jiǎn)單地總結(jié)一下﹐實(shí)現(xiàn)某一功能可能會(huì)有很多種方法﹐在此就沒有全部列出﹐歡迎大家繼續(xù)﹐以便和大家共享﹐共同探討﹐共同近步﹗(以下主要以O(shè)racle8I和DB2 7.X為例)。

 

1.如何取一表前n筆記錄的Oracle和DB2的寫法

Oracle 可以這樣實(shí)現(xiàn)﹕ Select * from user.bsempms where rownum<=n;

DB2 實(shí)現(xiàn)也可以這樣﹕ Select * from db2admin.bsempms fetch first n rows only;

另外也可以用 row_number() over() 去實(shí)現(xiàn)的;

2.如何取得當(dāng)前日期的Oracle和DB2的寫法

Oracle 可以這樣實(shí)現(xiàn)﹕ Select sysdate from dual;

DB2 可以這樣實(shí)現(xiàn)﹕ Select current timestamp from sysibm.sysdummy1;

3.如何連接字段的Oracle和DB2的寫法

Oracle 可以這樣實(shí)現(xiàn)﹕ Select emp_no||emp_nam from bsempms; Select concat(emp_no,emp_nam) from bsempms;

DB2 可以這樣實(shí)現(xiàn)﹕ Select emp_no||emp_nam from db2admin.bsempms; select emp_no concat emp_nam from db2admin.bsempms;

4.如何查詢表的結(jié)構(gòu)的Oracle和DB2的寫法

Oracle 可以這樣實(shí)現(xiàn)﹕ Select sysdate from dual;

  DB2 可以這樣實(shí)現(xiàn)﹕ Select current timestamp from sysibm.sysdummy1;

5.內(nèi)連接INNER JOIN的Oracle和DB2的寫法

Oracle可以這樣實(shí)現(xiàn)﹕ Select a.* from bsempms a,bsdptms b where a.dpt_no=b.dpt_no;

DB2 可以這樣實(shí)現(xiàn)﹕ Select * from db2admin.bsempms inner join db2admin.bsdptms on db2admin.bsempms.dpt_no=db2admin.bsdptms.dpt_no;

6.外連接的Oracle和DB2的寫法(右外連接,左外連接,完全外連接,組合外連接)

Oracle可以這樣實(shí)現(xiàn)﹕Select a.* from bsempms a,bsdptms b where a.dpt_no=b.dpt_no(+); Select a.* from bsempms a,bsdptms b wherea.dpt_no(+)=b.dpt_no;

DB2 可以這樣實(shí)現(xiàn)﹕

  1. Select * from db2admin.bsempms right outer join db2admin.bsdptms on db2admindb2admin.bsempms.dpt_no=db2admin.bsdptms.dpt_no;  
  2. Select * from db2admin.bsempms left outer join db2admin.bsdptms on db2admindb2admin.bsempms.dpt_no=db2admin.bsdptms.dpt_no;  
  3. Select * from db2admin.bsempms full outer join db2admin.bsdptms on db2admindb2admin.bsempms.dpt_no=db2admin.bsdptms.dpt_no;  

 

以上的相關(guān)內(nèi)容就是對(duì)DB2實(shí)現(xiàn)Oracle相關(guān)功能的介紹,望你能有所收獲。
 

責(zé)任編輯:佚名 來(lái)源: cnBeta.com
相關(guān)推薦

2010-08-04 11:18:09

2011-03-25 14:53:39

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

2010-08-09 10:00:25

DB2數(shù)據(jù)移動(dòng)

2010-08-11 12:43:45

DB2數(shù)據(jù)庫(kù)調(diào)優(yōu)

2009-12-16 10:48:42

DB2數(shù)據(jù)庫(kù)

2010-11-03 16:32:10

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

2010-08-11 14:32:55

DB2數(shù)據(jù)庫(kù)調(diào)優(yōu)

2010-08-04 13:30:49

2010-08-17 16:24:32

IBM DB2數(shù)據(jù)庫(kù)

2010-08-18 15:42:33

2010-08-12 09:25:22

DB2數(shù)據(jù)庫(kù)復(fù)原

2010-08-26 15:22:36

DB2新功能

2010-08-02 10:06:43

DB2數(shù)據(jù)移動(dòng)

2010-08-02 08:40:43

DB2數(shù)據(jù)庫(kù)性能

2011-03-15 14:13:56

JDBCDB2數(shù)據(jù)庫(kù)

2010-07-27 14:33:24

DB2數(shù)據(jù)庫(kù)

2010-08-06 09:39:27

DB2數(shù)據(jù)庫(kù)分區(qū)

2010-08-18 17:32:34

DB2數(shù)據(jù)庫(kù)

2010-09-07 16:16:04

DB2數(shù)據(jù)庫(kù)

2009-08-07 15:26:38

C#數(shù)據(jù)庫(kù)編程實(shí)例
點(diǎn)贊
收藏

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