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

Home -> Community -> Usenet -> c.d.o.server -> Re: "equal" Vs. "Like"

Re: "equal" Vs. "Like"

From: Sybrand Bakker <postbus_at_sybrandb.demon.nl>
Date: Sat, 23 Sep 2000 06:36:34 +0200
Message-ID: <969683703.23478.0.pluto.d4ee154e@news.demon.nl>

As the column name is varchar2(1), using like doesn't make sense to me. If the column isn't indexed, there will be no difference. If the column is indexed and you are using the cost-based optimiser, you should create a histogram on that column. Otherwise it wouldn't use the index anyway.
All those measures taken I think you should use =.

Hth,

Sybrand Bakker, Oracle DBA

"Eddie" <edawad_at_hotmail.com> wrote in message news:MNQy5.2042$bm4.219103_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.
>
>
>
Received on Fri Sep 22 2000 - 23:36:34 CDT

Original text of this message

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