1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
| With SR as
(
select 1 as num, 'REL Notes : 2' as des from dual union all
select 2 , 'REL Notes : 18' from dual union all
select 3 , 'REL Notes : ' from dual union all
select 4 , 'REL Notes :' from dual union all
select 5 , 'totototot' from dual
)
select num, des
, TO_NUMBER(COALESCE(TRIM(REPLACE(SUBSTR(DES, INSTR(DES, 'REL Notes :', 1, 1) + 11), CHR(10), CHR(32))), '0')) as rel_notes
from SR;
NUM DES REL_NOTES
--- -------------- ---------
1 REL Notes : 2 2
2 REL Notes : 18 18
3 REL Notes : 0
4 REL Notes : 0
5 totototot 0 |
Partager