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

Home -> Community -> Usenet -> c.d.o.misc -> Re: SQL..

Re: SQL..

From: ZEITGEIST <restaurant_at_the.end.of.the.universe>
Date: 1997/01/26
Message-ID: <5cg03l$rd0@news2.ee.net>#1/1

In article <01bc074a$fa13b0a0$6303fe0a_at_ppp.ncs.com.sg>, sfong_at_letterbox.com says...
>
>Why no rows selected when I have this statement?
>
>select desc, code from table_a where name = 'ABC'
>and code like '3%' and code like '7%' ;
>
>Please reply.
>
>Thanks
>
>Stella
>

I think you need to change it to something like this:

>select desc, code from table_a where name = 'ABC'
>and (code like '3%' or code like '7%') ;

I don't think your example would ever return a row because the conditions 'code like 3%' and 'code like 7%' would ever be both true at the same time.

Please correct me if I am wrong.

Brett Cunningham
zgeist_at_ee.net Received on Sun Jan 26 1997 - 00:00:00 CST

Original text of this message

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