Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Which is fastest? To_Date.. or Trunc...
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
![]() |
![]() |