I have this query which finds the position of sub string.
select position('-' || lower('i') in lower('GFT-iMB5-i'))
(this is an example it actually uses function variables to replace the strings)
This return 4
In a nut shell I want it to begin from the end of the string and not from the start.
meaning I want to get: 9
How can I do that?
One method is to reverse the values and do comparison that way:
select length('GFT-iMB5-i') - position(reverse('-' || lower('i')) in reverse(lower('GFT-iMB5-i')))
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With