I'm using Snowflake SQL. How can I remove everything after the last occurence of a character (_) and all digits in the end of a string?
For example:
foo_bar_2
foo_bar_3b
foo3
bar
should become:
foo_bar
foo_bar
foo
bar
I'm using Snowflake SQL. How can I remove everything after the last occurence of a character (_) and all digits in the end of a string?
For example:
foo_bar_2
foo_bar_3b
foo3
bar
should become:
foo_bar
foo_bar
foo
bar