Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: testing date
Sounds like a trunc() will help. For example
select * from table_a where trunc(col1, 'd') = trunc(sysdate, 'd');
Alternatively, a slightly better query is
select * from table_a where col1 >= tunc(sysdate, 'd') and col < trunc(sysdate, 'd') + 1;
The first one cannot make use of index on col1, so it is very inefficient for large table. The second query can make use of index on col1 (if the index exists).
Ed Lufker wrote in message <6q4sff$8f9$1_at_sloth.swcp.com>...
>Hi All:
>
>
>Does anyone have any pl/sql code that tests the date in a column and
>compares it to todays day.
>
>
>thanks in advance for any help
>
>eddie lufker
>
Received on Tue Aug 04 1998 - 06:55:49 CDT