Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: SQL SELECT with date restriction, please help !

Re: SQL SELECT with date restriction, please help !

From: Nicolas Ungern-Sternberg <nungern_at_sbe-online.com>
Date: Tue, 4 Sep 2001 09:58:44 +0200
Message-ID: <9n21ei$4j8$1@s1.read.news.oleane.net>


Thanks you every body for your responses !

between to_date('30/08/2001 00:00:00','DD/MM/YYYY HH24:MI:SS') and to_date('30/08/2001 23:59:59','DD/MM/YYYY HH24:MI:SS')

It's more easy ? no ?

Nicolas Ungern-Sternberg
"Reid Lai" <reidlai_at_netvigator.com> a écrit dans le message news: 3B8FC802.C462F0F8_at_netvigator.com...
>
>
> Reid Lai wrote:
>
> > All suggested queries seems very good. I got another WHERE clause.
> >
> > between to_date('30/08/2001') and (to_date('30/08/2001) + 0.99999)
> > - save operation time on multiply and supply
>
> should be "divide" not "supply"
>
> >
> > - can compare row in single conditional operatior and single calculation
> > operation (cannot avoid to_date function).
> >
> > Nicolas Ungern-Sternberg wrote:
> >
> > > hello every body,
> > >
> > > Sorry but my english is bad...
> > >
> > > 1 ) FIRST SELECT :
> > >
> > > select count(*) from sbedba.fiches
> > > where dateent=to_date('30/08/2001')
> > >
> > > COUNT(*)
> > > ---------
> > > 72
> > >
> > > Plan d'exécution
> > > ----------------------------------------------------------
> > > 0 SELECT STATEMENT Optimizer=CHOOSE (Cost=1 Card=1 Bytes=7)
> > > 1 0 SORT (AGGREGATE)
> > > 2 1 INDEX (RANGE SCAN) OF 'IDX_FICHES_DATEENT' (NON-UNIQUE)
> > > (Cost=1 Card=264 Bytes=1848)
> > >
> > > 2 ) SECOND SELECT
> > >
> > > select count(*) from sbedba.fiches
> > > where to_char(dateent,'DD/MM/YYYY')=to_date('30/08/2001')
> > >
> > > COUNT(*)
> > > ---------
> > > 1004
> > >
> > > Plan d'exécution
> > > ----------------------------------------------------------
> > > 0 SELECT STATEMENT Optimizer=CHOOSE (Cost=2395 Card=1 Bytes=7)
> > > 1 0 SORT (AGGREGATE)
> > > 2 1 TABLE ACCESS (FULL) OF 'FICHES' (Cost=2395 Card=2457
> > > Bytes=17199)
> > >
> > > I'm understand that the problem is the TIME in my DATEENT column ; But
what
> > > is the solution ???
> > >
> > > Thank you for advance,
> > >
> > > Nicolas.
> > >
> > > --
> > > Nicolas Ungern-sternberg
> > > Service informatique - 376
> > > nungern_at_sbe-online.com
> > > 03.21.10.08.35
>
Received on Tue Sep 04 2001 - 02:58:44 CDT

Original text of this message

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