FW: someone double-check me on this sql

  • From: "Mark W. Farnham" <mwf@xxxxxxxx>
  • To: <Oracle-L@xxxxxxxxxxxxx>
  • Date: Fri, 29 Jun 2012 16:53:31 -0400

oops. forgot the list.

-----Original Message-----
From: Mark W. Farnham [mailto:mwf@xxxxxxxx] 
Sent: Friday, June 29, 2012 4:27 PM
To: 'ChrisDavid.Taylor@xxxxxxxxxxxxxxx'
Subject: RE: someone double-check me on this sql

Toons gave you the formal logic already. Reading the original query as an
exclusion filter is helpful for some folks to grok why that transform is
true:

give me all the rows where the month is not 5 AND the year is not 2012.

So forget about the query plan for a bit (Oracle can do it any old way it
figures is cheapest as long as it gives you the logically correct answer).

Get a row
Is that row the nasty month number 5? If so, throw it away.
If not, is it the nasty year 2012? If so, throw it away.

What this does not explain is why you claim to only have gotten months 6-12
of 2011. Where, indeed, did the months 1-4 go?

Regardless, this made me think a bit about why such things are confusing so
I posted a blog entry
http://rsiz.wordpress.com/2012/06/29/year_month_virtual_column

Regards,

mwf
<snip>


--
//www.freelists.org/webpage/oracle-l


Other related posts:

  • » FW: someone double-check me on this sql - Mark W. Farnham