Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: "equal" Vs. "Like"
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
![]() |
![]() |