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 5DE53D1E20F for ; Wed, 12 May 2004 11:07:17 -0300 (ADT) 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 65654-03 for ; Wed, 12 May 2004 11:07:00 -0300 (ADT) Received: from www.postgresql.com (www.postgresql.com [200.46.204.209]) by svr1.postgresql.org (Postfix) with ESMTP id A0860D1E136 for ; Wed, 12 May 2004 11:06:55 -0300 (ADT) Received: from stan.ringways.co.uk (hub.ringways.co.uk [213.38.87.130]) by www.postgresql.com (Postfix) with ESMTP id 7F3FACF574F for ; Wed, 12 May 2004 11:06:54 -0300 (ADT) Received: from gary.ringways.co.uk ([10.1.1.2]) by stan.ringways.co.uk with esmtp (Exim 3.22 #1) id 1BNuNE-0004jX-00 for pgsql-sql@postgresql.org; Wed, 12 May 2004 15:06:16 +0100 Content-Type: text/plain; charset="iso-8859-1" From: Gary Stainburn Organization: Ringways Garages Ltd To: Subject: solved Re: view problem - too many rows out Date: Wed, 12 May 2004 15:06:35 +0100 User-Agent: KMail/1.4.3 References: <200405121102.31554.gary.stainburn@ringways.co.uk> In-Reply-To: <200405121102.31554.gary.stainburn@ringways.co.uk> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-Id: <200405121506.35979.gary.stainburn@ringways.co.uk> 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: 200405/108 X-Sequence-Number: 17822 On Wednesday 12 May 2004 11:02 am, Gary Stainburn wrote: > Hi folks. > [snip] > create view order_summary as > select > c.cs_id, cs.count as qty, c.cs_make, c.cs_code, c.cs_type, > cst.cst_desc, c.cs_colour, > o.or_id, > o.or_supp, o.or_date, o.or_received, o.or_no, orst.orst_desc as > order_state, > co.co_id, co.co_name, co.co_person, co.co_tel, > co.co_mobile, co.co_fax, co.co_email, co.co_type, > c.cs_comments > from consumables c, orders o, > (select cost_cs_id, cost_or_id, count(cost_cs_id) from cons_stock > where cost_or_id is not null > group by cost_cs_id, cost_or_id > ) cs, contacts co, > cons_locations cl, cons_types cst, order_states orst cons_locations shouldn't have been there > where cs.cost_cs_id = c.cs_id > and cs.cost_or_id = o.or_id > and c.cs_type = cst.cst_id > and o.or_supp = co.co_id > and o.or_state = orst.orst_id; [snip] -- Gary Stainburn This email does not contain private or confidential material as it may be snooped on by interested government parties for unknown and undisclosed purposes - Regulation of Investigatory Powers Act, 2000