Trim Suffixes in a column values
530678Dec 7 2007 — edited Dec 7 2007Hi:
I need to remove multiple suffix values from a column
for instance I have a column like this:
XFPSSYSTEM[b]-XXX
X6554610PDR[b]-P22
6554610PDR-ABCD
and I want remove defined suffixes such as -XXX, -P22, XYZ, etc, etc.
XFPSSYSTEM <-- removed -XXX
X6554610PDR <-- removed P22
6554610PDR-ABCD <-- does not have to remove any thing here
I used this
trim(substr('12345-AKA',1,instr('12345-AKA', '-AKA')-1))
but this only removes one suffix value of -AKA.
Please let me know if you have any ideas.
Thanks.