From: Leif B. Kristensen <leif@solumslekt.org>
To: pgsql-sql@postgresql.org
Subject: Help with a view
Date: Thu, 22 Sep 2005 19:29:35 +0200
Message-ID: <200509221929.36043.leif@solumslekt.org> (raw)
I've created a view 'principals' that gives me this output:
pgslekt=> select * from principals where event=15821;
person | event | place | sort_date | tag_type
--------+-------+-------+------------+----------
2 | 15821 | 1152 | 1999-09-17 | 4
3 | 15821 | 1152 | 1999-09-17 | 4
(2 rows)
How do I go about selecting the "other" person of this event, given that
I have one of them and the event number?
I'd also like a view that gives me the two rows combined into one, with
"person" replaced by p1 and p2.
--
Leif Biberg Kristensen
http://solumslekt.org/
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: leif@solumslekt.org
Subject: Re: Help with a view
In-Reply-To: <200509221929.36043.leif@solumslekt.org>
* 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