Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> question about substr

question about substr

From: haomiao <miaohaoz_at_ustc.edu>
Date: Mon, 23 Jul 2007 01:49:54 -0700
Message-ID: <1185180594.099186.316990@g12g2000prg.googlegroups.com>


Hi

(1) When I run

               select 1 from dual where '1       '  = substr('21',2,1)
           no result return.   There is  spaces in the left operand.


(2) When I run
select 1 from dual where '1 ' = substr('21', 2,1) || ' ' 1 result return
(3) And when I run
select 1 from dual where '1 ' = '1' 1 result return What is the difference between (1)and(3)? Can I find a better method than (2) , so I can eaily compare without counting the spaces in '1 ' Thanks.
Received on Mon Jul 23 2007 - 03:49:54 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US