| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> c.d.o.server -> Re: How to compare a date to sysdate
Sybrand Bakker schrieb:
>
> This is because there is a time (mm:ss) in the sysdate and maybe also in
> the readdate
> try
> select * from tab1row where readdate = trunc(sysdate) /* No need to select
> from dual, sysdate is a built-in function, trunc will cut off the time */
won't work if readdat has a time portion too
> or (worse)
> select * from tab1row where trunc(readdate) = trunc(sysdate)
indexes wont be used
> or (complicated, but it does work)
> select * from tab1row where readdate between trunc(sysdate) and
> trunc(sysdate) + 1/*day*/ -1/3600
third stat may use indexes, and works even though readate may have a time portion.
Matthias
--
grema_at_t-online.de
Received on Wed Mar 03 1999 - 02:27:57 CST
![]() |
![]() |