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 fastest? To_Date.. or Trunc...

Re: Which is fastest? To_Date.. or Trunc...

From: R. Nightingale <nighr_at_hotmail.com>
Date: Sun, 1 Aug 1999 19:24:55 -0500
Message-ID: <7o2or8$3fg$1@hyperion.nitco.com>


Trunc simply sets the date to midnight by removing the fraction. I guess you could accomplish the same thing by using a To_Char(datefield, 'YYYYMMDD') or something like that. I would imagine the Trunc approach would be quicker. The date datatype is already a 7-byte floating point number. You're welcome to post some benchmarks! --rn.

Magnus <magnus.johansson_at_araby-dalbo.comREMOVETHIS> wrote in message news:37A2105D.C2106A39_at_eudoramail.comREMOVETHIS...
> Hi,
>
> I have seen a couple of questions on comparing dates. Some recommend
> To_Date and some recommend Trunc to get rid of the "time-part" of the
> dates in the comparision. Does anyone know which is fastest when the
> query runs?
>
> Thanks!
>
> /Magnus
>
Received on Sun Aug 01 1999 - 19:24:55 CDT

Original text of this message

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