Removing 0's from field [message #1020] |
Thu, 21 March 2002 06:47 |
KK
Messages: 24 Registered: March 2002
|
Junior Member |
|
|
Hi!
I have data in a column that contains the following data:
TableA.Dept = 0006
TableA.Dept = 0010
TableB.Dept = 6
TableB.Dept = 10
I want to remove the preceeding 0's from the TableA.Dept number so I can compare it to TableB.Dept.
Any help or suggestions would be greatly appreciated!
Thank you!
|
|
|
Re: Removing 0's from field [message #1021 is a reply to message #1020] |
Thu, 21 March 2002 07:12 |
Senthil
Messages: 68 Registered: December 1999
|
Member |
|
|
ltrim should help you...
SQL> select * from t;
NO
----------
0006
0010
9999
SQL> select ltrim(no, '0') from t;
LTRIM(NO,'
----------
6
10
9999
that would work if the column type is varchar2...
|
|
|
|