select OVR_COMMENT,
substr(OVR_COMMENT, 1, instr(OVR_COMMENT,'/')-1) Time,
substr(OVR_COMMENT, instr(OVR_COMMENT,'/')+1, instr(OVR_COMMENT,'/',1,2)-instr(OVR_COMMENT,'/')-1) Reason,
substr(OVR_COMMENT, instr(OVR_COMMENT,'/',1,3)+1)
from override where wbu_name ='RVR'
的原始列是分裂使用單varchar列值作爲多列在Oracle SQL(/)字符
IVR時間= 20130409200450CST /原因= FUL // DESC = TOD_FULL_DAY
我的結果是
ROW | Val1 | Val2 | Val3 |
------------------------------------------------------------------
1 |RVR Time=20130409222756|Reason=FMLP|Desc=TOD_FULL_DAY |
2 |RVR Time=20130409201134|Reason=FUL |Desc=TOD_FAMILY_LEAVE |
實際結果,我想成爲
ROW | Val1 | Val2 | Val3 |
------------------------------------------------------------------
1 |20130409222756|FMLP|TOD_FULL_DAY |
2 |20130409201134|FUL |TOD_FAMILY_LEAVE |
請幫我解決上述問題。我嘗試子字符串的子字符串,但沒有爲我工作
此功能在Oracle 9i中不起作用。請讓我知道如果你已經修復這個 – madhan
查詢2應該在9i工作。 – San
是的,它與9i合作謝謝 – madhan