On Wed, 2 May 2001, Jeff Meeks wrote:
> What I am looking for is a query that will return a list of id's with a
> sum from table b and a sum from table c like this:
>
> id name sum(b) sum(a)
> 1 shell 34 50
> 2 jeff 40 20
>
> Thanks
> Jeff Meeks
> jmeekssr(at)net-serv(dot)com
SELECT id, name,
(SELECT sum(b) FROM b WHERE b.id=a.id) AS sum_b,
(SELECT sum(c) FROM c WHERE c.id=a.id) AS sum_c
FROM a;
--
Joel Burton <jburton(at)scw(dot)org>
Director of Information Systems, Support Center of Washington