| From: | Gary Stainburn <gary(dot)stainburn(at)ringways(dot)co(dot)uk> |
|---|---|
| To: | pgsql-sql <pgsql-sql(at)postgresql(dot)org> |
| Subject: | summary VIEW |
| Date: | 2002-05-06 11:41:10 |
| Message-ID: | E174gqQ-0007XM-00@stan.ringways.co.uk |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | 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 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
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Gary Stainburn | 2002-05-06 13:08:18 | Re: summary VIEW |
| Previous Message | Tom Lane | 2002-05-05 17:47:02 | Re: More long-string woes |