Re: Which of the two statements do you find is easier to understand?

From: Michael Moore <michaeljmoore_at_gmail.com>
Date: Fri, 6 May 2011 12:06:56 -0700
Message-ID: <BANLkTikALd46wvhKXEd7LYWTzPWesfiTpg_at_mail.gmail.com>



Actually I was thinking of going with #2 until I posted this. It's seem almost unanimous that #1 is easier to understand. So now I'm going with #1 based on popular opinion.

Thanks all for the sanity check.
Mike

On Fri, May 6, 2011 at 11:46 AM, Jared Still <jkstill_at_gmail.com> wrote:

> On Fri, May 6, 2011 at 11:08 AM, Rich Jesse <
> rjoralist2_at_society.servebeer.com> wrote:
>
>> Michael writes:
>>
>> > Which of the two statements do you find is easier to understand?
>> >
>> > WHERE (txv.business_unit2tcode NOT IN (41940)
>> > OR (txv.business_unit2tcode IN (41940) AND txv.ext_source_key IS
>> > NULL));
>>
>> I'll take what's behind Door #3:
>>
>> WHERE txv.business_unit2tcode != 41940 OR txv.ext_source_key IS NULL;
>>
>> Simple, to the point, and logically equivalent to your first WHERE clause.
>>
>>
> Agreed.
>
> One would hope this is SQL that is run infrequently...
>
>
> Jared Still
> Certifiable Oracle DBA and Part Time Perl Evangelist
> Oracle Blog: http://jkstill.blogspot.com
> Home Page: http://jaredstill.com
>

--
http://www.freelists.org/webpage/oracle-l
Received on Fri May 06 2011 - 14:06:56 CDT

Original text of this message