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

闡述Oracle decode函數(shù)的用法

數(shù)據(jù)庫 Oracle
今天我們主要和大家分享的是Oracle decode函數(shù)的正確用法以及對(duì)在實(shí)際操作中我們經(jīng)常使用的函數(shù)的介紹,下面就是文章的具體內(nèi)容分析。

以下的文章主要是對(duì)Oracle decode函數(shù)的正確用法的介紹,我們大家都知道Oracle函數(shù)庫里提供了N多的實(shí)用性特別號(hào)的函數(shù),例如,nvl, sign與round等,其中我們經(jīng)常用得,功能比較大的還是decode這個(gè)函數(shù)。這個(gè)函數(shù)的用法如下:

decode(表達(dá)式,條件1,結(jié)果1,條件2,結(jié)果2,...)中間有幾個(gè)條件與結(jié)果根據(jù)個(gè)人而定,如

decode(sign(100-20),1,20,-1,100)意思是說當(dāng)(100-20)大于零時(shí),結(jié)果為20,而當(dāng)(100-20)小于零時(shí),結(jié)果為100,其中的sign只是一個(gè)判斷符號(hào)的函數(shù)

假如要對(duì)一個(gè)企業(yè)的員工進(jìn)行工資調(diào)整,對(duì)于3000塊以下的提高10%,3000塊以上的提高5%,那么如果用我們一般的做法就是對(duì)工資進(jìn)行判斷,如果大于3000,就加5%,而低于3000的就加10%。不過現(xiàn)在有了這個(gè)Oracle decode函數(shù),那么就可以簡(jiǎn)單的用下面的語句:

  1. select decode(sign(salary-3000),1,salary*1.1,-1,salary*1.05) from employee 

上述的相關(guān)內(nèi)容就是對(duì)Oracle decode函數(shù)的用法的描述,希望會(huì)給你帶來一些幫助在此方面。

Oracle decode 函數(shù)

【編輯推薦】

  1. Oracle 11g調(diào)用函數(shù)幾種常用方法
  2. Oracle數(shù)據(jù)字典文檔經(jīng)典版詳解
  3. 提高Oracle數(shù)據(jù)庫性能可以通過優(yōu)化數(shù)據(jù)庫
  4. Oracle如何掌舵Sun開源技術(shù) 告別免費(fèi)成為主軸
  5. 對(duì)Oracle安全性的建設(shè)的建議
責(zé)任編輯:佚名 來源: 互聯(lián)網(wǎng)
相關(guān)推薦

2010-04-27 12:51:49

Oracle 函數(shù)de

2010-04-28 16:53:20

Oracle 函數(shù)

2010-11-04 11:45:10

Oracle DECO

2010-10-25 17:00:40

Oracle deco

2010-04-01 09:56:44

Oracle DECO

2010-11-18 15:46:41

Oracle Deco

2010-10-25 14:28:53

oracle trun

2010-10-25 16:52:48

oracle管道函數(shù)

2010-04-26 16:51:11

Oracle Deco

2010-04-30 17:58:55

Oracle trun

2010-10-25 16:13:31

Oracle to_d

2010-04-30 10:47:26

Oracle Nvl函

2010-05-04 12:10:08

Oracle over

2011-08-30 17:33:10

OracleSAS宏

2011-09-01 10:09:31

OracleDECODE常用窗口函數(shù)

2011-08-11 17:56:00

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

2010-10-25 17:22:24

oracle add_

2010-09-06 16:40:52

SQL函數(shù)

2010-10-27 15:03:47

Oracle with

2010-05-10 18:54:12

Oracle數(shù)據(jù)庫索引
點(diǎn)贊
收藏

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