Re: What does LIKE '%%' actually do in a WHERE clause?

From: Subodh Deshpande <deshpande.subodh_at_gmail.com>
Date: Fri, 7 Oct 2011 15:29:55 +0530
Message-ID: <CAJsOtB4DF-a1E-YVh-xxPvqofBoTMNXQUEPjR_zU+xDNH8QqNw_at_mail.gmail.com>



yes Norman, I also thought like you..
cause when we say '%' then its any character where as null is not a character..if we want to include null then we use generally nvl(col_name, value) in query clause..
The '%%' yes, I am carrying this germ in my mind.. I mean is it an interface dependent thing..eg..say if we want to use wild character in sql query like wise is '%' a wild character for this particular interface..

thanks and take care..subodh

On 7 October 2011 13:22, Norman Dunbar <oracle_at_dunbar-it.co.uk> wrote:

> Morning Grant,
>
> > Maybe I'm mis-interpreting things, but wouldn't LIKE '%' actually be
> semantically equivalent to IS NOT NULL. That is, for something to be LIKE
> "anything", it must therefore be known (or more specifically knowable) in
> order to evaluate its "likeness".
> Yes, to all intents and purposes, they are equivalent. I haven't checked
> if the CBO considers them to be the same though!
>
> > The %% thing is however, new and interesting to me :)
> It had me foxed as well. I'd never seen it until this came up, and I
> thought it was a special format of the wildcard - I admit that at first
> I thought it was a way of specifying the percent sign - why would they
> be looking for a string like '%' came to mind! ;-)
>
>
>
> Cheers,
> Norm.
>
> --
> Norman Dunbar
> Dunbar IT Consultants Ltd
>
> Registered address:
> Thorpe House
> 61 Richardshaw Lane
> Pudsey
> West Yorkshire
> United Kingdom
> LS28 7EL
>
> Company Number: 05132767
> --
> http://www.freelists.org/webpage/oracle-l
>
>
>

-- 
==============================
DO NOT FORGET TO SMILE TODAY
==============================


--
http://www.freelists.org/webpage/oracle-l
Received on Fri Oct 07 2011 - 04:59:55 CDT

Original text of this message