You could achieve the desired output with the following combination of substr()
and instr()
functions:
select substr(inv_nm, 1, instr(inv_nm, '-')-1) as dept_no
, substr(inv_nm, instr(inv_nm, '-', -1) + 1) as DIVISION_NO
from inventory
Result:
DEPT_NO DIVISION_NO
----------- -----------
1000 200
10000 2000
900 100
2000 2200
70000 2100
700 700
4000 4000
2000 2000
500 1000
8000 750
6000 2000
100 1000
12 rows selected