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

Home -> Community -> Usenet -> c.d.o.tools -> Re: A beginner's question

Re: A beginner's question

From: <sybrandb_at_my-deja.com>
Date: 2000/06/30
Message-ID: <8jhni5$rpa$1@nnrp1.deja.com>#1/1

In article <395a0da9$1_at_dnewserver.firstcom.cl>,   "Luis Aucañir" <laucanir_at_hotmail.com> wrote:
> Hi!
>
> Is valid the next expression?:
>
> SELECT *
> FROM Customer
> WHERE TRUNC(SchedStart) = TRUNC(SYSDATE);
>
> or is better this?:
>
> SELECT *
> FROM Customer
> WHERE TO_CHAR(SchedStart, 'DD-MM-YYYY') = TO_CHAR(SYSDATE,
> 'DD-MM-YYYY');
>
> Thanks in advance,
> Luis Aucañir H.
> laucanir_at_hotmail.com
>
>

Both sql statements are valid, and they don´t make any difference, not in results, not in terms of performance. They both perform a full table scan, regardless whether or not there is and index present. In Oracle 8i, where you can create function based indexes (provided you have the Enterprise Edition', you could consider using trunc(Schedstart) as index.

Hth,
Sybrand Bakker, Oracle DBA

--
Sybrand Bakker, Oracle DBA

All standard disclaimers apply
------------------------------------------------------------------------


Sent via Deja.com http://www.deja.com/
Before you buy.
Received on Fri Jun 30 2000 - 00:00:00 CDT

Original text of this message

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