Eliminating first character [message #7566] |
Sun, 22 June 2003 14:42 |
MM
Messages: 27 Registered: July 2002
|
Junior Member |
|
|
Hi,
I need to eliminate the first charecter in the STRING for example
'E1000001' i need to remove the E and return the number part and i dont have the exact count of the number it may vary from 2 and grow more.
Thanks in advance
|
|
|
|
Re: Eliminating first character [message #7569 is a reply to message #7566] |
Sun, 22 June 2003 23:54 |
Nalaneelan
Messages: 12 Registered: June 2003
|
Junior Member |
|
|
Select To_Number(substr(string, 2, length(string)))
from
.
With the use of above query, from second character till the last char of the varchar2 column will be converted to Number datatype.
|
|
|
|
Re: Eliminating first character [message #7642 is a reply to message #7566] |
Thu, 26 June 2003 05:11 |
Gilbey
Messages: 87 Registered: March 2002
|
Member |
|
|
Try This...
SQL> SELECT * FROM AX;
NO
------------------------------
E100001
E100002
E100003
E100004
E100005
E100006
E100007
7 rows selected.
SQL> SELECT SUBSTR(NO,2) "TRUNCATED NUMBER" FROM AX;
TRUNCATED NUMBER
---------------------------
100001
100002
100003
100004
100005
100006
100007
7 rows selected.
Hope this helps........
|
|
|