X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 5ADF8D1B536 for ; Fri, 31 Oct 2003 19:24:44 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 60675-04 for ; Fri, 31 Oct 2003 15:24:14 -0400 (AST) Received: from smtp01.gvl-priv.sys.nuvox.net (smtp.nuvox.net [64.89.70.9]) by svr1.postgresql.org (Postfix) with ESMTP id C137CD1B8A2 for ; Fri, 31 Oct 2003 15:23:52 -0400 (AST) Received: from CSISERV1.computer-systems.com (209.248.179.178.nw.nuvox.net [209.248.179.178]) by smtp01.gvl-priv.sys.nuvox.net (8.12.8/8.12.8) with ESMTP id h9VJNqci030886 for ; Fri, 31 Oct 2003 14:23:53 -0500 content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Subject: selecting problems X-MimeOLE: Produced By Microsoft Exchange V6.0.6249.0 Date: Fri, 31 Oct 2003 14:19:49 -0500 Message-ID: <6A1C87CA83BA8C419B1262B3728B12D102D435@csiserv1.computer-systems.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: selecting problems Thread-Index: AcOf4/Oo6Ft1DnIBT0uhaAyZqEc1Tw== From: "Shaun Watts" To: X-Virus-Scanned: by amavisd-new at postgresql.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200310/414 X-Sequence-Number: 15814 What I am trying to do is select all the rows out of the categories table (see below) and select the sum of j_amount out of the judgment table. Right now it is only returning the categories that are in the judgment table. I want it to return those fields with the amounts out of the judgment table, but also the all the other categories from the categories table with 0 as there amount. Does anyone have a suggestion. select ca_code,ca_desc,sum(j_amount) as sum_amt,ca_dis_cycle from categories LEFT OUTER JOIN judgment ON (j_category=3Dca_code) where j_case_no=3D'45698' and j_party_no=3D1 group by ca_code,ca_desc,ca_dis_cycle Thanks, Shaun ---------------------------------------------------------------------=20 Shaun, =20 Phone 1-317-913-4160 Fax 1-317-913-4175=20 CSI - Computer Systems, Inc. "Dictionary is the only place that success comes before work. Hard work is = the price we=20 must pay for success. I think you can accomplish anything if you're willing= to pay the price." Vince Lombardi=20