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

Home -> Community -> Usenet -> c.d.o.misc -> Re: Which is faster? <> or Between

Re: Which is faster? <> or Between

From: Joel Garry <joel-garry_at_home.com>
Date: 1 Jul 2003 16:58:31 -0700
Message-ID: <91884734.0307011558.69d914d0@posting.google.com>


"M" <noreply_at_noreply.com> wrote in message news:<bdeja0$23h2$1_at_news.hgc.com.hk>...
> It seems to me that the 'between' should work faster, as long as you don't
> have something like to_char, to_date, etc.
>
> Correct me if I was wrong.

You was wrong. Search for the word "BETWEEN" in the Tuning and Performance manual and you should see something like:

BETWEEN Operator
The optimizer always replaces a condition that uses the BETWEEN comparison
operator with an equivalent condition that uses the >= and <= comparison
operators. For example, the optimizer replaces the first condition below with the
second:
sal BETWEEN 2000 AND 3000
sal >= 2000 AND sal <= 3000

Now flame anyone that did not tell the OP that, or at least where to look it up.

>
> "Just_Buy" <ohbej_at_hotmail.com> wrote in message
> news:65275ae5.0306250757.b859f09_at_posting.google.com...
> > Which of the following methods is faster for retrieving records within a
> date range?
> >
> > Option A:
> > Paid_Date >= '01-JAN-2003' AND Paid_Date <= '01-MAR-2003'
> >
> > Option B:
> > Paid_Date BETWEEN '01-JAN-2003' AND '01-MAR-2003'
> >
> > Thanks!

jg

--
@home.com is bogus.
You're still wrong.
Received on Tue Jul 01 2003 - 18:58:31 CDT

Original text of this message

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