Re: EQUAL vs LIKE

From: Matt B. <mcb_at_fightspam.sd.znet.com>
Date: Fri, 22 Sep 2000 18:54:16 -0700
Message-ID: <sso32ce8pale7a_at_corp.supernews.com>


"Eddie" <edawad_at_hotmail.com> wrote in message news:XOQy5.2047$bm4.219555_at_paloalto-snr1.gtei.net...
> Hi,
> Which is faster:
>
> Select column_name1
> from table_name
> where column_name2 like 'Y%'
>
> or
>
> Select column_name1
> from table_name
> where column_name2 = 'Y'
>
> knowing that column_name2 is VARCHAR2(1) and contains either 'Y' or 'N'
>
> Thank you for your help,
>
> Eddie.

AFAIK, should be the same. However in this example...:

Select column_name1
from table_name
where column_name2 like '%Y'

 or

 Select column_name1
from table_name
where column_name2 = 'Y'

...the "LIKE" would be slower here because if there's an index, it won't be used.

-Matt Received on Sat Sep 23 2000 - 03:54:16 CEST

Original text of this message