Re: A beginner's question

From: Luc Bosman <l.bosman_at_wanadoo.be>
Date: 2000/06/30
Message-ID: <9gnolsokk7eke50kn22nof2md8s27p2cc2_at_4ax.com>#1/1


On Wed, 28 Jun 2000 10:39:15 -0400, "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
>

It's the same but you must know one thing. If an index exist on schedstart, the use of a function on the field will prevent Oracle to use the index => full scan at each time.

-- 
Luc Bosman
DEV/2000 Software Engineer
Database and Network Administrator
l.bosman_at_wanadoo.be
ICQ 37011625          http://users.skynet.be/kobukai/
 ---------------------------------------------------- 
|  -°)                                          (°-  |
|  /\\  Linux the choice of the GNU generation  //\  |
| _\_v                                          v_/_ |
 ---------------------------------------------------- 
Received on Fri Jun 30 2000 - 00:00:00 CEST

Original text of this message