Wilder1626
asked on
Oracle - Query pull string up to a specific character
Hi,
I have this query that i would like to modify but i don't know how.
In the Description field, i have value like: TT_MB_1. TT_CC_6, TT_FF_9 etc...
I would like to get everything from the string up to the last underscore "_".
Ex: If i have TT_MB_1, it would give me "TT_MB_".
How can i do that?
Thank you for your help
I have this query that i would like to modify but i don't know how.
Select Description from Comment_T
In the Description field, i have value like: TT_MB_1. TT_CC_6, TT_FF_9 etc...
I would like to get everything from the string up to the last underscore "_".
Ex: If i have TT_MB_1, it would give me "TT_MB_".
How can i do that?
Thank you for your help
INSTR('TT_MB_1. TT_CC_6, TT_FF_9', '_', -1)
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank you for your help. This is exactly what i needed.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Ho!!! you are correct, sorry, i actually took that one:
select substr(description,1,instr(description,'_',-1)) from comment_t