Received: from localhost.localdomain (postgresql.org [64.49.215.8]) by localhost (Postfix) with ESMTP id 293A6475AED for ; Mon, 6 May 2002 07:43:15 -0400 (EDT) Received: from stan.ringways.co.uk (unknown [213.38.87.130]) by postgresql.org (Postfix) with ESMTP id 9226D475AD6 for ; Mon, 6 May 2002 07:43:13 -0400 (EDT) Received: from gary.ringways.co.uk ([10.1.1.2] helo=there) by stan.ringways.co.uk with smtp (Exim 3.33 #2) id 174gqQ-0007XM-00 for pgsql-sql@postgresql.org; Mon, 06 May 2002 12:39:54 +0100 Content-Type: text/plain; charset="iso-8859-1" From: Gary Stainburn Organization: Ringways Garages Ltd To: pgsql-sql Subject: summary VIEW Date: Mon, 6 May 2002 12:41:10 +0100 X-Mailer: KMail [version 1.3.2] MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-Id: X-Archive-Number: 200205/37 X-Sequence-Number: 7673 Hi all, Taking that I have an aircraft seating table, as below, How could I create a VIEW to replace the capacity table shown underneath? create table matrix ( matrixaircraft character varying (4) references aircraft(aircraftid) not null, matrixrow int4 not null, matrixseat character references seating(seatid), matrixwidth int4 not null, primary key (matrixaircraft, matrixrow) ); -- capacity should be a VIEW based on matrix create table capacity ( capaircraft character varying (4) references aircraft(aircraftid) not null, capseat character references seating(seatid) not null, capcount int4, primary key (capaircraft, capseat) ); -- 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