Received: (qmail 29975 invoked from network); 28 Jun 2012 21:37:28 -0500
Received: from freelists-180.iquest.net (HELO turing.freelists.org) (206.53.239.180)
  by static-ip-85-25-126-90.inaddr.ip-pool.com with SMTP; 28 Jun 2012 21:37:24 -0500
Received: from localhost (localhost [127.0.0.1])
 by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id BF729ED8E2A;
 Thu, 28 Jun 2012 22:37:24 -0400 (EDT)
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=freelists.org;
 s=turing; t=1340937444; bh=1Z74u5PymOGlywVTehNfjvcV0oxFxwOwf6E0pgQ4
 Nn8=; h=From:To:Date:Subject:Message-ID:Content-type:MIME-Version:
	 Content-Transfer-Encoding:Sender:Reply-To:List-help:
	 List-unsubscribe:List-Id:List-subscribe:List-owner:List-post:
	 List-archive; b=itI1qbxLOIIT8LxvcWU4NrAJ8DyhDVbZLWiXYFnlM1+mdcpShU
 gVGM24CIznR2T2QHaK6nyzfvgkKyxRMTWZPmDsufq64tnEQPRXvpC3CtO0wYYMIpnjL
 2Yx/MOxmrCj0fawrL8NlAPYohFCLBgJNTGGzFKFxhLzDfKR23T2014=
X-Virus-Scanned: Debian amavisd-new at localhost.localdomain
Received: from turing.freelists.org ([127.0.0.1])
 by localhost (turing.freelists.org [127.0.0.1]) (amavisd-new, port 10024)
 with ESMTP id 0lVL8rsuYTlp; Thu, 28 Jun 2012 22:37:24 -0400 (EDT)
Received: from turing.freelists.org (localhost [127.0.0.1])
 by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id E500CED7620;
 Thu, 28 Jun 2012 22:36:41 -0400 (EDT)
Received: with ECARTIS (v1.0.0; list oracle-l); Thu, 28 Jun 2012 22:36:00 -0400 (EDT)
Received: from localhost (localhost [127.0.0.1])
 by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id 5F705ED74AF
 for <oracle-l@freelists.org>; Thu, 28 Jun 2012 22:36:00 -0400 (EDT)
Received: from turing.freelists.org ([127.0.0.1])
 by localhost (turing.freelists.org [127.0.0.1]) (amavisd-new, port 10024)
 with ESMTP id 6JRQIW89aufs for <oracle-l@freelists.org>;
 Thu, 28 Jun 2012 22:36:00 -0400 (EDT)
Received: from db3outboundpool.messaging.microsoft.com (db3ehsobe003.messaging.microsoft.com [213.199.154.141])
 by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id C4F9AED74AE
 for <oracle-l@freelists.org>; Thu, 28 Jun 2012 22:35:59 -0400 (EDT)
Received: from mail90-db3-R.bigfish.com (10.3.81.228) by
 DB3EHSOBE006.bigfish.com (10.3.84.26) with Microsoft SMTP Server id
 14.1.225.23; Fri, 29 Jun 2012 02:34:11 +0000
Received: from mail90-db3 (localhost [127.0.0.1])	by mail90-db3-R.bigfish.com
 (Postfix) with ESMTP id B623B3005B7	for <oracle-l@freelists.org>; Fri, 29 Jun
 2012 02:34:10 +0000 (UTC)
X-Forefront-Antispam-Report: CIP:12.23.250.36;KIP:(null);UIP:(null);IPV:NLI;H:SPOBMEXC06.adprod.directory;RD:none;EFVD:NLI
X-SpamScore: 4
X-BigFish: VPS4(zzc85fh8c40kzz1202hz31izz2dh2a8h668h839ha12hd25hf0ah)
Received: from mail90-db3 (localhost.localdomain [127.0.0.1]) by mail90-db3
 (MessageSwitch) id 1340937230668715_28346; Fri, 29 Jun 2012 02:33:50 +0000
 (UTC)
Received: from DB3EHSMHS006.bigfish.com (unknown [10.3.81.253])	by
 mail90-db3.bigfish.com (Postfix) with ESMTP id 55B112E0068	for
 <oracle-l@freelists.org>; Fri, 29 Jun 2012 02:33:45 +0000 (UTC)
Received: from SPOBMEXC06.adprod.directory (12.23.250.36) by
 DB3EHSMHS006.bigfish.com (10.3.87.106) with Microsoft SMTP Server (TLS) id
 14.1.225.23; Fri, 29 Jun 2012 02:33:45 +0000
From: "Taylor, Chris David" <ChrisDavid.Taylor@ingrambarge.com>
To: "'oracle-l@freelists.org'" <oracle-l@freelists.org>
Date: Thu, 28 Jun 2012 21:35:29 -0500
Subject: someone double-check me on this sql
Thread-Topic: someone double-check me on this sql
Message-ID: <C5533BD628A9524496D63801704AE56D75B2BA0321@SPOBMEXC14.adprod.directory>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
acceptlanguage: en-US
Content-type: text/plain
MIME-Version: 1.0
X-OriginatorOrg: ingrambarge.com
Content-Transfer-Encoding: 8bit
X-archive-position: 43529
X-ecartis-version: Ecartis v1.0.0
Sender: oracle-l-bounce@freelists.org
Errors-to: oracle-l-bounce@freelists.org
X-original-sender: ChrisDavid.Taylor@ingrambarge.com
Precedence: normal
Reply-To: ChrisDavid.Taylor@ingrambarge.com
List-help: <mailto:ecartis@freelists.org?Subject=help>
List-unsubscribe: <oracle-l-request@freelists.org?Subject=unsubscribe>
List-software: Ecartis version 1.0.0
List-Id: oracle-l <oracle-l.freelists.org>
X-List-ID: oracle-l <oracle-l.freelists.org>
List-subscribe: <oracle-l-request@freelists.org?Subject=subscribe>
List-owner: <mailto:steve.adams@ixora.com.au>
List-post: <mailto:oracle-l@freelists.org>
List-archive: <http://www.freelists.org/archives/oracle-l>
X-list: oracle-l

I'm  a bit fuzzy at the moment due to pain meds after a minor surgery so I'm hoping someone can spot my error (if I have an error)

Table has months, years and 'x' number of rows for each

The table has Years 2011 and 2012
In 2011, it has months 1-12
And in 2012 it has months 1-5

I run this:
Select month, year, count(*) -- month, and year are actual column names
From some_table
Where (month != 5 and year != 2012)
Group by month, year
/

The data set I get is Months 6-12 for 2011 *ONLY*

Shouldn't that query *ONLY* exclude MONTH=5 and YEAR 12 together?  (instead of ALL 2012 and ALL 5s?)




Chris Taylor

"Quality is never an accident; it is always the result of intelligent effort."
-- John Ruskin (English Writer 1819-1900)

Any views and/or opinions expressed herein are my own and do not necessarily reflect the views of Ingram Industries, its affiliates, its subsidiaries or its employees.




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


