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 Question

Re: SQL Question

From: Daniel Morgan <dmorgan_at_exesolutions.com>
Date: Wed, 16 Oct 2002 15:42:03 GMT
Message-ID: <3DAD88C3.C1F5DAAF@exesolutions.com>


meblahyoublah_at_eatme.net wrote:

> Hi all,
>
> I am running a simple select from SQL*Plus to create a view on an 8i
> database on NT. The last statement in the query reads as follows:
>
> and (date_termination is null OR date_termination >=
> to_date('01-jun-2002','dd-mon-yyyy')
>
> If I run it this way it returns the records with date_termination null
> but not the records with date_termination >= 01-jun-2002. If I reverse
> the ordering of the clauses around the OR as in
>
> and (date_termination >= to_date('01-jun-2002','dd-mon-yyyy') OR
> date_termination is null )
>
> then it returns both the records containing null term dates and the
> records with term dates >= 01-jun-2002. What I don't understand is why
> the change in position would change the result set if the whole
> statement is enclosed in parens. I know that AND binds more tightly
> than OR but the docs say the parens should overide this. Is it an an
> 'unknown' value form the null that is causing the evaluation to
> terminate befoe the second clause is checked? I can make it do what I
> want but i don't understand why which is annoying.
>
> Thank you,
> mark
>
>

Based on reading your posting and Roman's response ... my only statement would be that unless you provide exact information on operating system name, version and patch level ... and Oracle version, edition, and patch level ... it is impossible for anyone to attempt to duplicate what you have done.

I have not been able to duplicate it using 8.1.7.0.0 on NT4 or 9.2.0 on Win2K or 9.2.0 on HP/UX 11 or 8.1.7.3 on Solaris 8.

Daniel Morgan Received on Wed Oct 16 2002 - 10:42:03 CDT

Original text of this message

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