summary VIEW - Mailing list pgsql-sql

From Gary Stainburn
Subject summary VIEW
Date
Msg-id E174gqQ-0007XM-00@stan.ringways.co.uk
Whole thread Raw
Responses Re: summary VIEW  (Gary Stainburn <gary.stainburn@ringways.co.uk>)
List pgsql-sql
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
referencesseating(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     


pgsql-sql by date:

Previous
From: Tom Lane
Date:
Subject: Re: More long-string woes
Next
From: "Josh Berkus"
Date:
Subject: Re: Odd behavior with timestamp/interval arithmetic