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 Date comparison more efficient?

Re: Which Date comparison more efficient?

From: Daniel Morgan <damorgan_at_exxesolutions.com>
Date: Tue, 06 May 2003 22:30:34 -0700
Message-ID: <3EB899F9.3096C9ED@exxesolutions.com>


Jim Kennedy wrote:

> Bench mark it. How about
> adate>= to_date('10-10-03','MM-DD-YY')
> and adate< to_date('10-11-03','MM-DD-YY')
> That would be a LOT more efficient than the other two assuming there is an
> index on adate.
> Jim
>
> --
> Replace part of the email address: kennedy-down_with_spammers_at_attbi.com
> with family. Remove the negative part, keep the minus sign. You can figure
> it out.
> "Skinny Guy" <skinnychineseguy_at_hotmail.com> wrote in message
> news:f9b5a61d.0305061451.4cc8051b_at_posting.google.com...
> > 1) trunc(aDate) = to_date('10-10-03','MM-DD-YY')
> >
> > or
> >
> > 2) to_char(aDate,'MM-DD-YY') = to_date('10-10-03','MM-DD-YY')

And I would urge you to use 'MM-DD-YYYY' or 'MM-DD-RR' unless you have a very constrained set of dates.

--
Daniel Morgan
http://www.outreach.washington.edu/extinfo/certprog/oad/oad_crs.asp
damorgan_at_x.washington.edu
(replace 'x' with a 'u' to reply)
Received on Wed May 07 2003 - 00:30:34 CDT

Original text of this message

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