pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Gary Stainburn <gary.stainburn@ringways.co.uk>
To: pgsql-sql <pgsql-sql@postgresql.org>
Subject: summary VIEW
Date: Mon, 6 May 2002 12:41:10 +0100
Message-ID: <E174gqQ-0007XM-00@stan.ringways.co.uk> (raw)

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     



view thread (2+ messages)  latest in thread

Message-ID: <E174gqQ-0007XM-00@stan.ringways.co.uk>
Permalink:  ../E174gqQ-0007XM-00@stan.ringways.co.uk/
Also on:    postgresql.org/message-id/E174gqQ-0007XM-00@stan.ringways.co.uk

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: gary.stainburn@ringways.co.uk
  Subject: Re: summary VIEW
  In-Reply-To: <E174gqQ-0007XM-00@stan.ringways.co.uk>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox