I want to return all characters before the 2nd occurrence of the character slash '/' (if any) in PostgreSQL.
Input Column:
/apple/orange/banana
/
/mango
/avocado/kiwi
Desired Output Column:
/apple
/
/mango
/avocado
Can anyone help with this please?