From: Graeme Merrall <gmerrall@email.com>
To: pgsql-sql@postgresql.org
Subject: sum a subquery?
Date: Fri, 14 Apr 2000 16:55:45 +1200
Message-ID: <004001bfa5cd$b1d0e7c0$899d60cb@inspire.net.nz> (raw)
Dunno if this is the right way to ask a question but...
I'm inheriting some data and need to perform a query on it to sum a column of figures. The only problem I have to sum on the condition of the contents of another column.
e.g.
12.23 I
23.45 P
56.67 I
11.11 P
SO I need to sum all the I's and all the P's. Is it possible to use a sub-select to do this or what. I've a feeling I'm messing around in the right area but can't quite get it together.
Cheers,
Graeme
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-sql@postgresql.org
Cc: gmerrall@email.com
Subject: Re: sum a subquery?
In-Reply-To: <004001bfa5cd$b1d0e7c0$899d60cb@inspire.net.nz>
References: <004001bfa5cd$b1d0e7c0$899d60cb@inspire.net.nz>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox