In later versions I can use this regexp_substr
:
SELECT
ID,
regexp_substr(ID, '[^.]+', 1, 2) DATA 1,
regexp_substr(ID, '[^.]+', 1, 3) DATA 2
FROM employees
Table: Employees
ID
--------------------------
2017.1.3001-ABC.01.01
2017.2.3002-ABCD.02.02
2017.303.3003-ABC.03.03
2017.404.3004-ABCD.04.04
Expected output:
ID DATA 1 DATA 2
------------------------ ------ ---------
2017.1.3001-ABC.01.01 1 3001-ABC
2017.2.3002-ABCD.02.02 2 3002-ABCD
2017.303.3003-ABC.03.03 303 3003-ABC
2017.404.3004-ABCD.04.04 404 3004-ABCD
Please help me to get the sub-string between .
characters in ID column in SQL Oracle 9i.
You don't need regular expressions - just use
SUBSTR
andINSTR
: