偷偷摘套内射激情视频,久久精品99国产国产精,中文字幕无线乱码人妻,中文在线中文a,性爽19p

Oracle decode函數(shù)的語法介紹。

數(shù)據(jù)庫 Oracle
Oracle數(shù)據(jù)庫中的decode函數(shù)是最常用的函數(shù)之一,下文對該函數(shù)的用法作了詳細(xì)的闡述說明,希望對您能夠有所幫助。

作為Oracle函數(shù)的其中之一,Oracle decode函數(shù)在Oracle數(shù)據(jù)庫中發(fā)揮著非常重要的作用,下面就為您介紹Oracle decode函數(shù)的用法,供您參考。

我們大家都知道Oracle函數(shù)庫里提供了N多的實用性特別好的函數(shù),例如,nvl, sign與round等,其中我們經(jīng)常用的,功能比較強(qiáng)大的還是Oracle decode函數(shù)函數(shù)。Oracle decode函數(shù)函數(shù)的用法如下:

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

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

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

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

上述的相關(guān)內(nèi)容就是對Oracle decode函數(shù)的用法的描述。

 

 

【編輯推薦】

Oracle to_char函數(shù)的使用

oracle函數(shù)返回表的實現(xiàn)

詳解Windows下卸載Oracle數(shù)據(jù)庫

詳解如何將Oracle安裝為Linux服務(wù)

帶您了解Oracle FBI索引

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

2010-11-04 11:45:10

Oracle DECO

2010-04-26 16:51:11

Oracle Deco

2010-10-25 17:17:50

Oracle日期轉(zhuǎn)換函

2010-10-25 15:46:56

Oracle TRIM

2010-05-10 18:22:28

Oracle deco

2010-04-27 12:51:49

Oracle 函數(shù)de

2010-04-01 09:56:44

Oracle DECO

2010-04-28 16:53:20

Oracle 函數(shù)

2010-11-16 16:16:42

Oracle創(chuàng)建用戶

2010-11-18 15:46:41

Oracle Deco

2010-11-16 16:23:04

Oracle修改用戶

2011-08-30 17:33:10

OracleSAS宏

2010-04-21 15:22:54

Oracle游標(biāo)

2011-09-01 10:09:31

OracleDECODE常用窗口函數(shù)

2011-08-11 17:56:00

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

2009-11-26 18:28:07

PHP函數(shù)trim()

2011-07-14 10:21:19

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

2010-09-06 16:40:52

SQL函數(shù)

2010-10-09 16:11:21

Mysql函數(shù)

2010-04-29 13:12:18

Oracle合并函數(shù)
點贊
收藏

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