Re: Help with a view - Mailing list pgsql-sql

From Dmitri Bichko
Subject Re: Help with a view
Date
Msg-id F18A6F7CF1661F46920F2CF713122FED46CCAD@mail.aveo.aveopharma.com
Whole thread Raw
In response to Help with a view  ("Leif B. Kristensen" <leif@solumslekt.org>)
Responses Re: Help with a view
List pgsql-sql
SELECT * FROM principals WHERE event = 15821 AND person != 2?

Dmitri

> -----Original Message-----
> From: pgsql-sql-owner@postgresql.org
> [mailto:pgsql-sql-owner@postgresql.org] On Behalf Of Leif B.
> Kristensen
> Sent: Thursday, September 22, 2005 1:30 PM
> To: pgsql-sql@postgresql.org
> Subject: [SQL] Help with a view
>
>
> 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/
>
> ---------------------------(end of
> broadcast)---------------------------
> TIP 4: Have you searched our list archives?
>               http://archives.postgresql.org
The information transmitted is intended only for the person or entity to which it is addressed and may contain
confidentialand/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any
actionin reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you
receivedthis in error, please contact the sender and delete the material from any computer 


pgsql-sql by date:

Previous
From: Axel Rau
Date:
Subject: Re: Updating cidr column with network operator
Next
From: "Leif B. Kristensen"
Date:
Subject: Re: Help with a view