Get value between "," in HANA Database

42 Views Asked by At

I have a column with the string "ItemBO:M101,1000129A,A" I want to extract only the text "1000129A"

Many thanks in advance!

I tried using the function

SELECT SUBSTR_AFTER ('ItemBO:M101,1000129A,A',',') "substr after" FROM DUMMY;

but the result is 1000129A,A

1

There are 1 best solutions below

0
charj On

Solved using

SELECT SUBSTRING_REGEXPR('[^,]+' IN 'ItemBO:M101,1000129A,A' FROM 1 OCCURRENCE 2) FROM DUMMY;