sum a subquery? - Mailing list pgsql-sql

From Graeme Merrall
Subject sum a subquery?
Date
Msg-id 004001bfa5cd$b1d0e7c0$899d60cb@inspire.net.nz
Whole thread Raw
List pgsql-sql
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

pgsql-sql by date:

Previous
From: Tom Lane
Date:
Subject: Re: Function xxxx() does no exist
Next
From: "Graeme Merrall"
Date:
Subject: Doh! (HTML mail)