19c SE2
I need to extract a part of a string, like just the street address:
777 Brockton Avenue
I have tried this, but I need the text before the comma.
WITH data AS
(
SELECT '777 Brockton Avenue, Abington MA 2351' str FROM dual
)
SELECT str,
REGEXP_SUBSTR(str, '[^,]+$') new_str
FROM data;
--Solution
WITH data AS
(
SELECT '777 Brockton Avenue, Abington MA 2351' str FROM dual
)
SELECT str,
REGEXP_SUBSTR(str, '[^,]+') new_str
FROM data;
Thanks!