Skip to Main Content

previously word

656678Aug 25 2008 — edited Aug 26 2008
Hi,
I have a table like this;
ID (int), Field1 (varchar2)
---------
1, abc_de_XXX_fg
2, abcd_e_XXX
3, a_b_XXX_c_d
4, a_b_cde
5, XXX_a_b_c
6, abcdef_XXX_ghij_klm_n
...
I want find previously word ("_" is word seperator) before XXX.
Results by this example:
ID (int), Field1 (varchar2), RESULT
---------
1, abc_de_XXX_fg, de
2, abcd_e_XXX, e
3, a_b_XXX_c_d, b
4, a_b_cde, null
5, XXX_a_b_c, null
6, abcdef_XXX_ghij_klm_n, abcdef
Thanks.
Comments
Post Details
Added on Aug 25 2008
7 comments
5,190 views