How do we substring from reverse in Postgres? In oracle we can provide the no.of occurrences of the pattern and extract the expected records. In Postgres we do not have such option.
I tried using substring(), left() and right() functions, still it is not working. Any suggestion would be helpful.
Value in the column,
col1
100~500~~~~Bangalore~~~~KA~null~Train
Expected result,
Train
~? Or the string between the (n)th and the (n+1)th occurrence of~?