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: Reid Lai <reidlai_at_netvigator.com>
Date: Sat, 01 Sep 2001 01:21:19 +0800
Message-ID: <3B8FC78E.C1F53547@netvigator.com>


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 - 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 Fri Aug 31 2001 - 12:21:19 CDT

Original text of this message

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