成人免费xxxxx在线视频软件_久久精品久久久_亚洲国产精品久久久_天天色天天色_亚洲人成一区_欧美一级欧美三级在线观看

使用Oracle Instr()函數(shù)進(jìn)行多條件組合查詢方案

數(shù)據(jù)庫 Oracle
我們今天主要和大家介紹的是正確的使用Oracle Instr()和decode()函數(shù)來進(jìn)行多條件的組合查詢的方案,以下就是文章的具體內(nèi)容介紹。

以下的文章主要介紹的是如何正確的使用Oracle Instr()和decode()函數(shù)來進(jìn)行多條件的組合查詢,在相關(guān)系統(tǒng)中我們經(jīng)常遇到要處理的多條件組合查詢的相關(guān)情況,使用instr()和decode()函數(shù)的實現(xiàn)方法。

下面先說明一下instr()的功能和語法:(函數(shù)的語法是從處得到的,相當(dāng)清晰明了:)

 

  1. In Oracle/PLSQL, the instr function returns the location of a substring in a string.  
  2. The syntax for the instr function is:  
  3. instr (string1, string2, [start_position], [nth_appearance])  
  4. string1 is the string to search.  
  5. string2 is the substring to search for in string1.  
  6. start_position is the position in string1 where the search will 
    start. This argument is optional. If omitted, it defaults to 1. 
    The first position in the string is 1. If the start_position is negative, 
    the function counts back start_position number of characters from 
    the end of string1 and then searches towards the beginning of string1.  
  7. nth_appearance is the nth appearance of string2. This is optional. If omiited, it defaults to 1.  

 

再說明一下decode()的功能和語法:

 

  1. In Oracle/PLSQL, the decode function has the functionality of an IF-THEN-ELSE statement.  
  2. The syntax for the decode function is:  
  3. decode ( expression , search , result [, search , result]... [, default] )  
  4. expression is the value to compare.  
  5. search is the value that is compared against expression.  
  6. result is the value returned, if expression is equal to search.  
  7. default is optional. If no matches are found, the decode will return default. 
    If default is omitted, then the decode statement will return null (if no matches are found).  

 

綜合使用得到的SQL語句如下:

select e.到達(dá)日期,

e.角色名,

d.單據(jù)標(biāo)題,

d.單據(jù)編號,

e.節(jié)點編號,

e.處理動作,

e.處理日期,

b.流程實例編號

from gzl_流程類型a,

gzl_流程實例b,

gzl_流程定義c,

dj_單據(jù) d,

gzl_流程流轉(zhuǎn)狀態(tài) e

where a.流程類型編號 = c.流程類型編號 and e.處理標(biāo)記 = '是'

and e.用戶id = 'tetdmis' and b.流程定義編號 = c.流程定義編號

and b.活動編號 = d.單據(jù)編號 and c.流程定義編號 = b.流程定義編號

and e.流程實例編號 = b.流程實例編號

and instr(decode(:流程類型條件, '-1', a.流程類型編號, :流程類型條件), a.流程類型編號) > 0

and (to_char(e.處理日期, 'yyyy-mm-dd') between :開始日期 and :結(jié)束日期)

and instr(decode(:節(jié)點名稱條件, '-1', e.處理動作, :節(jié)點名稱條件),

e.處理動作) > 0

以上的相關(guān)內(nèi)容就是對使用Oracle Instr()與decode()函數(shù)進(jìn)行多條件組合查詢,系統(tǒng)中遇到了要處理多條件組合查詢的情況,使用instr()和decode()函數(shù)的實現(xiàn)方法。的介紹,望你能有所收獲。

【編輯推薦】

  1. 對Oracle數(shù)據(jù)字典的文檔描述
  2. Oracle to_char的用法的描述
  3. Oracle struts2中相關(guān)日期輸入顯示某些問題的方案
  4. Oracle 11g調(diào)用相關(guān)函數(shù)的5種方法
  5. 調(diào)用Oracle procedure在pl/sql中的操作
責(zé)任編輯:佚名 來源: 互聯(lián)網(wǎng)
相關(guān)推薦

2010-05-06 14:11:55

Oracle多條件查詢

2009-09-15 17:45:34

Linq多條件

2010-04-30 09:34:24

Oracle多條件查詢

2009-09-15 09:33:46

linq多條件查詢

2009-09-15 11:34:47

Linq多條件查詢

2010-11-09 15:18:37

SQL Server多

2009-06-29 09:03:31

Hibernate多條

2025-05-07 09:32:00

2010-10-25 10:55:11

Oracle函數(shù)索引

2010-09-25 16:42:45

sql語句

2020-12-01 11:13:00

MySQL8

2009-05-19 14:34:52

Oraclehash優(yōu)化

2023-11-17 15:34:03

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

2010-04-26 14:43:17

Oracle遞歸條件查

2010-10-26 12:03:25

Oracle備份

2010-05-07 11:00:25

Oracle多表查詢

2010-10-25 10:20:33

ORACLE函數(shù)

2010-10-25 17:08:34

oracle聚合函數(shù)

2010-10-28 15:38:24

Oracle to_d

2010-07-15 09:14:32

SQL server組
點贊
收藏

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

主站蜘蛛池模板: 国产一区二区三区四区三区四 | 特一级黄色毛片 | 又黑又粗又长的欧美一区 | 欧美一区二区三区在线 | 99精品久久久 | 欧美日韩中文字幕 | 欧美日韩一区二区三区四区 | 午夜影院在线观看 | 亚洲高清电影 | 日韩成人免费视频 | 亚洲成人精品一区 | 欧美精品1区2区3区 精品国产欧美一区二区 | 国产一区二 | 国产午夜在线观看 | 九色av| 中文字幕欧美一区二区 | hsck成人网| 国产精品99久久久久久久久久久久 | 啪一啪 | 天天爽夜夜操 | 这里只有精品99re | 91久久久久久久久久久久久 | 欧美日韩综合一区 | 91精品国产乱码久久久久久久久 | 亚洲欧美激情网 | 一区二区三区回区在观看免费视频 | 欧美综合一区 | 国产欧美一级二级三级在线视频 | 国产成人精品a视频 | 久久99久久 | 成人午夜影院 | 国产成人精品一区二区三区视频 | 欧美日韩在线免费观看 | 国产日韩精品一区二区 | 欧美激情在线一区二区三区 | 中文字幕一区二区三区不卡 | 国产精品久久久久久久久久三级 | 亚洲高清三级 | 久久久www | 日韩精品在线播放 | 免费毛片网站在线观看 |