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: These WHERE clause are equal ?

Re: These WHERE clause are equal ?

From: damorgan <dan.morgan_at_ci.seattle.wa.us>
Date: Tue, 26 Feb 2002 21:13:32 GMT
Message-ID: <3C7BFA7B.D1504453@ci.seattle.wa.us>


Yes and no. Depends on your data. And, of course, my assumption that what you posted is not what you actually ran as your CASE2 is definitely missing a few things ... starting with the word "WHERE".

PS: The WHERE clause in Case1 should have TO_DATE added to it. What you have may work ... but Oracle does not guarantee it will work.

Daniel Morgan

R Chin wrote:

> Are the WHERE clauses below equivalent ?
>
> stamp_date has time stamp (ie '02/08/2002 12:57:51 PM')
> and I don't care about the time.
>
> Case 1)
> select * from TBL_LOG
> where TRUNC(stamp_date) BETWEEN '04-FEB-2002' AND '09-FEB-2002'
>
> Case 2)
> select * from TBL_LOG
> stamp_date BETWEEN TO_DATE('04-FEB-2002') AND TO_DATE('09-FEB-2002') +
> .99999
>
> rowid comparison seems to match.
>
> Thanks
Received on Tue Feb 26 2002 - 15:13:32 CST

Original text of this message

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