pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Dmitri Bichko <dbichko@aveopharma.com>
To: Leif B. Kristensen <leif@solumslekt.org>
To: pgsql-sql@postgresql.org
Subject: Re: Help with a view
Date: Thu, 22 Sep 2005 14:03:40 -0400
Message-ID: <F18A6F7CF1661F46920F2CF713122FED46CCAD@mail.aveo.aveopharma.com> (raw)

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 confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking 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 computer



view thread (5+ messages)  latest in thread

Message-ID: <F18A6F7CF1661F46920F2CF713122FED46CCAD@mail.aveo.aveopharma.com>
Permalink:  ../F18A6F7CF1661F46920F2CF713122FED46CCAD@mail.aveo.aveopharma.com/
Also on:    postgresql.org/message-id/F18A6F7CF1661F46920F2CF713122FED46CCAD@mail.aveo.aveopharma.com

 · 

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: dbichko@aveopharma.com, leif@solumslekt.org
  Subject: Re: Help with a view
  In-Reply-To: <F18A6F7CF1661F46920F2CF713122FED46CCAD@mail.aveo.aveopharma.com>

* 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