I have a multi-valued column , MISC_CONTENT with the following string in the column:
amount = 7995 ;channel = SXXXN21 ;group_header = NPS099 ;currency = EUR
How can retrieve the value NPS099 by lookup with group_header?
I have a multi-valued column , MISC_CONTENT with the following string in the column:
amount = 7995 ;channel = SXXXN21 ;group_header = NPS099 ;currency = EUR
How can retrieve the value NPS099 by lookup with group_header?
We can try using REGEXP_SUBSTR
:
WITH yourTable AS (
SELECT 'amount = 7995 ;channel = SXXXN21 ;group_header = NPS099 ;currency = EUR' AS col FROM dual
)
SELECT
REGEXP_SUBSTR(col, '(^|\s|;)group_header = (.*?)\s*(;|$)', 1,1,NULL,2)
FROM yourTable;