Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Truncating Certain Charaters
If the rule is to return the STDNT_NUM without the S, regardless of
where the S appears, you can use REPLACE.
SQL*Plus: Release 9.0.1.4.0 - Production on Thu Sep 22 08:38:07 2005
(c) Copyright 2001 Oracle Corporation. All rights reserved.
SQL> create table t1 (s_num varchar2(10));
Table created.
SQL> insert into t1 values ('12345');
1 row created.
SQL> c/12345/S1234
1* insert into t1 values ('S1234')
SQL> /
1 row created.
SQL> c/1234/12345
1* insert into t1 values ('S12345')
SQL> /
1 row created.
SQL> select * from t1;
S_NUM
SQL> select replace(s_num, 'S')
2 from t1;
REPLACE(S_
Regards,
Daniel Fink
Received on Thu Sep 22 2005 - 09:44:09 CDT