Return-Path: <oracle-l-bounce@freelists.org>
Delivered-To: 2-oracle-l@orafaq.com
Received: (qmail 31537 invoked from network); 11 Sep 2007 14:22:09 -0500
Received: from freelists-180.iquest.net (HELO turing.freelists.org) (206.53.239.180)
  by 69.64.49.119 with SMTP; 11 Sep 2007 14:22:02 -0500
Received: from localhost (localhost [127.0.0.1])
 by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id 8385B741563;
 Tue, 11 Sep 2007 14:43:16 -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 03141-10; Tue, 11 Sep 2007 14:43:16 -0400 (EDT)
Received: from turing (localhost [127.0.0.1])
 by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id EB9A974153C;
 Tue, 11 Sep 2007 14:43:15 -0400 (EDT)
Received: with ECARTIS (v1.0.0; list oracle-l); Tue, 11 Sep 2007 13:58:45 -0400 (EDT)
Received: from localhost (localhost [127.0.0.1])
 by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id 005197412E7
 for <oracle-l@freelists.org>; Tue, 11 Sep 2007 13:58:45 -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 24817-04 for <oracle-l@freelists.org>;
 Tue, 11 Sep 2007 13:58:44 -0400 (EDT)
Received: from wa-out-1112.google.com (wa-out-1112.google.com [209.85.146.183])
 by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id 11DE87412CC
 for <oracle-l@freelists.org>; Tue, 11 Sep 2007 13:58:41 -0400 (EDT)
Received: by wa-out-1112.google.com with SMTP id k22so2211809waf
        for <oracle-l@freelists.org>; Tue, 11 Sep 2007 11:37:19 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=beta;
        h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references;
        bh=jsplnNKrRerEfL7htcA/bUfEAx17jfh/qKf1Ef5EXZ0=;
        b=s9+ExIh6c0EM1Km3kdD1vKiMjir6qoXhh4xYwXZjTqKXh9/AAsN6xPG7Px7p4BcyRFAPULsDbayP7XRfAtFlcHwWEsfXUcRswUobNpJLiALDHj/QLY94aZis09aif1Y1bX29obPGS0inRLToFPKBMr/4ydQ0JZlBe7z9D+9icag=
DomainKey-Signature: a=rsa-sha1; c=nofws;
        d=gmail.com; s=beta;
        h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references;
        b=CmeUuBr7s1vpr/3M9Wi9awb6HqghlMtvQGHAHXYFeHnAgS/8y2AfWjj7w4snKdpj1TB+TaKN/UFk36TDPyxUddTf42lV7HrYFQQmvC7E9474ZcpkrDQH9xL8j/p6AOu6GSZyqsL3EhuqUlTUJrs9nVK/OLQD/1MofIC0BXwwb7k=
Received: by 10.143.168.14 with SMTP id v14mr323269wfo.1189535839513;
        Tue, 11 Sep 2007 11:37:19 -0700 (PDT)
Received: by 10.142.112.11 with HTTP; Tue, 11 Sep 2007 11:37:19 -0700 (PDT)
Message-ID: <be592d550709111137v15b04ba9i9600b6be057c9ead@mail.gmail.com>
Date: Tue, 11 Sep 2007 19:37:19 +0100
From: "David Sharples" <davidsharples@gmail.com>
To: lyallbarbour@sanfranmail.com
Subject: Re: sum of a column (development question)
Cc: oracle-l@freelists.org
In-Reply-To: <20070911173238.4B8D11CE303@ws1-6.us4.outblaze.com>
MIME-Version: 1.0
Content-Type: multipart/alternative; boundary="----=_Part_21698_6221040.1189535839503"
References: <20070911173238.4B8D11CE303@ws1-6.us4.outblaze.com>
X-archive-position: 1446
X-ecartis-version: Ecartis v1.0.0
Sender: oracle-l-bounce@freelists.org
Errors-to: oracle-l-bounce@freelists.org
X-original-sender: davidsharples@gmail.com
Precedence: normal
Reply-to: davidsharples@gmail.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
X-Virus-Scanned: Debian amavisd-new at localhost.localdomain
------=_Part_21698_6221040.1189535839503
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

group the records by year and filter it by the two years you want

select year, sum(total) where year in xxx group by year


On 11/09/2007, Lyall Barbour <lyallbarbour@sanfranmail.com> wrote:
>
> Hi again,
>    Development question.  User wants the sum of all the purchase orders
> for this year and last year.  I'm trying to get it in the same select
> statement.  I want something like this, but don't know how to get it.
>

------=_Part_21698_6221040.1189535839503
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

<div>group the records by year and filter it by the two years you want</div>
<div>&nbsp;</div>
<div>select year, sum(total) where year in xxx group by year<br><br>&nbsp;</div>
<div><span class="gmail_quote">On 11/09/2007, <b class="gmail_sendername">Lyall Barbour</b> &lt;<a href="mailto:lyallbarbour@sanfranmail.com">lyallbarbour@sanfranmail.com</a>&gt; wrote:</span>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">Hi again,<br>&nbsp;&nbsp; Development question.&nbsp;&nbsp;User wants the sum of all the purchase orders for this year and last year.&nbsp;&nbsp;I&#39;m trying to get it in the same select statement.&nbsp;&nbsp;I want something like this, but don&#39;t know how to get it.
<br></blockquote></div><br>

------=_Part_21698_6221040.1189535839503--
--
http://www.freelists.org/webpage/oracle-l


