I have a table in redshift running PostgreSQL in which one of the columns is url.
I need to extract parameters from this url.
ie. if url=foo.bar?param1=a¶m2=b¶m1=c
I need the value of param1 which is c from this url
Tried a few solutions like
(string_to_array(url,'param1='))[array_upper(string_to_array(url,'param1='),1)]
and
regexp_matches
Redshift does not allow arrays, so both methods are useless. Is there a way to solve this using SQL ?
param1=([^&=\s]+)(?!.*param1);).