Trim Column Data [message #447062] |
Thu, 11 March 2010 15:06  |
ThereUare
Messages: 3 Registered: March 2010 Location: Melbourne, FL
|
Junior Member |
|
|
Need to do this
Column1
--------
5648_6844_20020201
6878_6845_20051201
9845_6548_20080307
Need to change it to this
Column1
--------
20020201
20051201
20080307
So I basically need to remove the leading part of the string using the "_" underscore as the delimiter.
So I thought this would work, but no luck.
SELECT LTRIM('_', Column1) "NewCOL" From table;
Any help please!!!
|
|
|
|
Re: Trim Column Data [message #447064 is a reply to message #447063] |
Thu, 11 March 2010 15:22   |
ThereUare
Messages: 3 Registered: March 2010 Location: Melbourne, FL
|
Junior Member |
|
|
Thanks, but it only leaves the leading part of the string. I need to trailing part. So anything after the last underscore.
Can you give me an example. I'm fairly new at this.
|
|
|
|
|
|
Re: Trim Column Data [message #447223 is a reply to message #447098] |
Fri, 12 March 2010 08:26   |
ThereUare
Messages: 3 Registered: March 2010 Location: Melbourne, FL
|
Junior Member |
|
|
Thank you all for your help.
This seemed to work great.
SELECT SUBSTR(Column1,INSTR(Column1,'_',-1)+1) AS Col1 FROM table;
|
|
|
|
|
|