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: Use like clause more then once

Re: Use like clause more then once

From: DA Morgan <damorgan_at_psoug.org>
Date: Tue, 29 May 2007 14:28:44 -0700
Message-ID: <1180474123.465224@bubbleator.drizzle.com>


Jeremy Smith wrote:
> Currently 9i, will be moving to 10g this year. I tried joining the
> tables and doing to like statements, but it would give back zero
> records.
>
> SELECT distinct srv.SERVER_ID,srv.SERVER_NAME,srv
> FROM serverdb.servers srv inner join services svc on srv.SERVER_ID =
> svc.SERVER_ID
> WHERE (svc_display_name LIKE '%Microsoft Exchange%' and
> svc_display_name LIKE '%TSM%') and
> status_id = 1
>
>
> If I did only one like at a time it should have around 200 records
> returned. So I assume that oracle doesn't like 2 or more like
> staments in the same where statement.

You seem to be confusing AND and OR.

svc_display_name LIKE '%Microsoft Exchange%' is highly unlikely to also meet this test svc_display_name LIKE '%TSM%'

-- 
Daniel A. Morgan
University of Washington
damorgan_at_x.washington.edu
(replace x with u to respond)
Puget Sound Oracle Users Group
www.psoug.org
Received on Tue May 29 2007 - 16:28:44 CDT

Original text of this message

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