Re: How extract time values from date fields?

From: Sergey Tavanets <Sergey_at_cu.kiev.ua>
Date: Sun, 17 Jan 1999 09:56:23 +0200
Message-ID: <77s56i$qpc$2_at_whale.gu.net>


Hi!

You can use TRUNC function to extract time portion but if you have large tables which
you query you'll suffer serious performance decrease in such queries because indexes
on date columns won't be used (unless you plan to use Oracle8i where they claimed to
support expression indexes). So you may consider allocating a column to store time
portion of your dates which will be filled by a trigger.

Regards,

Sergey.

Maarten Meijer <M.Meijer_at_accu.uu.nl> wrote in message 369F40E5.9D497113_at_accu.uu.nl...
>Hello Oracle programmers,
>Could anyone solve this little problem? In a PL/SQL program,
>I'm trying to
>
>select ... from ...
>where time0 between time1 and time2
>
>time0, time1 and time2 are of type DATE, but I'm only interested
>in the time portion of these dates!
>Since time0 is being input by a user, the date portion of time0
>is set to the first of the current month and year, while time1
>and time2 can have other month and year values.
>So how do I ignore these day, month and year values??
>
>Thanks!
>--
>Maarten Meijer (030)2531660/2805001 http://www.accu.nl/~mmeijer
> ACCU (Academisch Computercentrum Utrecht) fax (030)2531633
> Budapestlaan 6, P.O.Box 80011, 3508 TA Utrecht NL
Received on Sun Jan 17 1999 - 08:56:23 CET

Original text of this message