X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id CE119DAAC1 for ; Thu, 22 Sep 2005 15:01:04 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 11716-02 for ; Thu, 22 Sep 2005 18:00:59 +0000 (GMT) Received: from mail.aveo.aveopharma.com (67.109.105.227.ptr.us.xo.net [67.109.105.227]) by svr1.postgresql.org (Postfix) with SMTP id 03700DAAE6 for ; Thu, 22 Sep 2005 15:00:58 -0300 (ADT) X-MimeOLE: Produced By Microsoft Exchange V6.5.7226.0 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Subject: Re: Help with a view Date: Thu, 22 Sep 2005 14:03:40 -0400 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [SQL] Help with a view Thread-Index: AcW/nAIE6IiLrCbBS1CXoUMsQXieoAAA8xAg From: "Dmitri Bichko" To: "Leif B. Kristensen" , X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.069 required=5 tests=[AWL=0.019, FORGED_RCVD_HELO=0.05] X-Spam-Level: X-Archive-Number: 200509/210 X-Sequence-Number: 22757 SELECT * FROM principals WHERE event =3D 15821 AND person !=3D 2? Dmitri > -----Original Message----- > From: pgsql-sql-owner@postgresql.org=20 > [mailto:pgsql-sql-owner@postgresql.org] On Behalf Of Leif B.=20 > Kristensen > Sent: Thursday, September 22, 2005 1:30 PM > To: pgsql-sql@postgresql.org > Subject: [SQL] Help with a view >=20 >=20 > I've created a view 'principals' that gives me this output: >=20 > pgslekt=3D> select * from principals where event=3D15821; > person | event | place | sort_date | tag_type > --------+-------+-------+------------+---------- > 2 | 15821 | 1152 | 1999-09-17 | 4 > 3 | 15821 | 1152 | 1999-09-17 | 4 > (2 rows) >=20 > How do I go about selecting the "other" person of this event,=20 > given that=20 > I have one of them and the event number?=20 >=20 > I'd also like a view that gives me the two rows combined into=20 > one, with=20 > "person" replaced by p1 and p2. > --=20 > Leif Biberg Kristensen > http://solumslekt.org/ >=20 > ---------------------------(end of=20 > broadcast)--------------------------- > TIP 4: Have you searched our list archives? >=20 http://archives.postgresql.org The information transmitted is intended only for the person or entity to = which it is addressed and may contain confidential and/or privileged mate= rial. Any review, retransmission, dissemination or other use of, or takin= g of any action in reliance upon, this information by persons or entities= other than the intended recipient is prohibited. If you received this in= error, please contact the sender and delete the material from any comput= er