Re: LIKE OPERATOR

From: FaheemRao <faheemrao_at_yahoo.com>
Date: 28 Sep 2001 15:44:18 -0700
Message-ID: <43b58913.0109281444.8451384_at_posting.google.com>


OK Hassan,

try this
select count(*) from balance
where

(p_no = '&p_no' and descript like '%Alm%') or 
(p_no = '&p_no' and descript like '%Cabi%') or 
(p_no = '&p_no' and descript like '%Chai%');
    

Faheem Rao

hassan_ayub_at_yahoo.com (Hassan Ayub) wrote in message news:<1df2b71.0109280720.3e624128_at_posting.google.com>...
> Hi,
>
> Is there any possibility that one can use the LIKE operator in a
> query in the following manner: ( I mean more than one LIKE operator)
>
> select count(*) from balance
> where p_no = '&p_no'
> and descript like '%Alm%'
> or descript like '%Cabi%'
> or descript like '%Chai%';
>
> When I run this query, it does not return records specifically from
> the given p_no, instead it return records from all the employees in
> the BALANCE table.
> On the other hand if I use the IN operator, then I will have to type
> in the whole descript statement which in some cases is 1000 characters
> long.
>
> Regards
>
> Hassan Ayub
Received on Sat Sep 29 2001 - 00:44:18 CEST

Original text of this message