Im trying to select all substings from certain URL's but I know there is a smarter way to do it.
Her is what I need:
from the URL:
I would like to get everything before the last 2 '-', so in this case:
this is the approach I am using now, it gets the job done but it's pretty rustic:
select array_to_string((string_to_array(url,'-'))[1:array_length(string_to_array(url,'-'),1)-2],'-')
