表內容如下:1.中文              -->理想狀態下   希望抓出來的結果為 1
2.中文             -->理想狀態下   希望抓出來的結果為 2
3.中文            -->注意,此處的.不是平常的.   希望抓出來的結果為 3
a.1.中文          -->出現字母   希望抓出來的結果為 a.1
a. 2.中文        -->出現空格   希望抓出來的結果為 a. 2
中文                 -->沒字母或數字開頭,也沒空格,希望抓出來的結果為Null我想把這些1、2、3、a.1、a.2都抓出來我自己也嘗試寫了個:select regexp_substr(item_content,'[^\w+\.]*'),from adm_que_item A where qid='090013' and nls_upper(item_tid) <>'H'
沒用...希望高手幫忙..

解决方案 »

  1.   

    select  (case when substr(item_content,instr(item_content,'中文'))<>''
                       then substr(item_content,instr(item_content,'中文'))
                       else null end) col      from adm_que_item
      

  2.   


    试试这个
    SQL>  Select REGEXP_REPLACE('aa.中文','([a-z].*).中文', '\1') FROM dual;
     
    REGEXP_REPLACE('AA.中文','([A-
    ------------------------------
    aa
      

  3.   

    select rtrim(regexp_substr('a.2.中文','[^中文]+'),'.') from dual 
      

  4.   

    Select REGEXP_REPLACE(item_content,'([a-z].*).中文', '\1') rtn from adm_que_item 
      

  5.   

    select REGEXP_SUBSTR (ITEM_CONTENT,'([[0-9a-zA-Z]|\.]*[[:space:]]*)*') myKey1 from table