I have an Oracle query using
SELECT REGEXP_SUBSTR('500 Oracle Parkway, Redwood Shores, CA',',[^,]+,')
FROM DUAL;
It returns the output as below:
, Redwood Shores,
I am trying to get the exact same result in SQL Server. I tried to do it as below
substring(text, patindex, length)
But I struggled with length specification.
Can you please let me know how I can achieve this is in SQL Server?
Try this: