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: Novice: select by time

Re: Novice: select by time

From: Niall Litchfield <n-litchfield_at_audit-commission.gov.uk>
Date: Thu, 27 Jun 2002 17:38:22 +0100
Message-ID: <3d1b3f7e$0$8510$ed9e5944@reading.news.pipex.net>


If there were gazillions of rows then you could create a function based index on the to_char function.

--
Niall Litchfield
Oracle DBA
Audit Commission UK
*****************************************
Please include version and platform
and SQL where applicable
It makes life easier and increases the
likelihood of a good answer

******************************************
"Thomas Gaines" <Thomas.Gaines_at_noaa.gov> wrote in message
news:3D1B3885.554BF083_at_noaa.gov...

> Daniel -
>
> Yes, that would certainly work. But since my mind is focused
> on query performance recently, wouldn't this be better, especially
> if there are gazillions of rows?
>
> SELECT fields
> FROM table
> WHERE trunc(date_field) = date_field;
>
> Just wonderin'... ;-)
>
> Tom
>
>
>
> Daniel Morgan wrote:
>
> > Per-Arne Hellarvik wrote:
> >
> > > trunc(<datetime>) should do the work....
> > >
> > > On Thu, 27 Jun 2002 16:34:09 +0200, dsmcd wrote:
> > >
> > > > Hello...
> > > >
> > > > I'd like to select all records whose time is 00:00:00 in a datetime
> > > > field ('MM/DD/YY HH24:MI:SS').
> > > >
> > > > Any suggestions?
> > > >
> > > > Thanks in advance,
> > > > D.
> >
> > This will remove the time ... not select the time.
> >
> > Try this instead:
> >
> > SELECT fields
> > FROM table
> > WHERE TO_CHAR(date_field, 'HH:MI:SS') = '00:00:00';
> >
> > Daniel Morgan
>
>
>
Received on Thu Jun 27 2002 - 11:38:22 CDT

Original text of this message

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