Home » SQL & PL/SQL » SQL & PL/SQL » Eliminating first character
Eliminating first character [message #7566] Sun, 22 June 2003 14:42 Go to next message
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 #7567 is a reply to message #7566] Sun, 22 June 2003 21:07 Go to previous messageGo to next message
Shailender Mehta
Messages: 49
Registered: June 2003
Member
Select substr(string, 2, length(string))
from dual
Re: Eliminating first character [message #7569 is a reply to message #7566] Sun, 22 June 2003 23:54 Go to previous messageGo to next message
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 #7579 is a reply to message #7569] Mon, 23 June 2003 10:16 Go to previous messageGo to next message
MM
Messages: 27
Registered: July 2002
Junior Member
Thanks for your help
Re: Eliminating first character [message #7642 is a reply to message #7566] Thu, 26 June 2003 05:11 Go to previous message
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........
Previous Topic: PRAGMA
Next Topic: Copying data
Goto Forum:
  


Current Time: Thu Apr 25 08:35:02 CDT 2024