pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Osvaldo Rosario Kussama <osvaldo_kussama@yahoo.com.br>
To: chester c young <chestercyoung@yahoo.com>
Cc: sql pgsql <pgsql-sql@postgresql.org>
Subject: Re: problem join
Date: Fri, 27 Jul 2007 12:47:25 -0300
Message-ID: <46AA138D.3070601@yahoo.com.br> (raw)
In-Reply-To: <820562.64742.qm@web54307.mail.re2.yahoo.com>
References: <820562.64742.qm@web54307.mail.re2.yahoo.com>

chester c young escreveu:
> having problem joining these correctly:
> 
> schedule
> - cal_id references calendar not null
> - usr_id references users not null
> = unique( calZ_id, usr_id )
> - result_no not null
> 
> activity
> - cal_id references calendar not null
> - usr_id references users not null
> = unique( cal_id, usr_id )
> - from_ts timestamp not null
> 
> trying to join
> - cal_id
> - usr_id
> - schedule.result_no (might be null)
> - activity.from_ts (might be null)
> where schedule.usr_id = activity.usr_id would result in one row
> 



Try:
SELECT * FROM schedule FULL OUTER JOIN activity
               USING (cal_id, usr_id) ....

Osvaldo




view thread (2+ messages)

Message-ID: <46AA138D.3070601@yahoo.com.br>
Permalink:  ../46AA138D.3070601@yahoo.com.br/
Also on:    postgresql.org/message-id/46AA138D.3070601@yahoo.com.br

 · 

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: osvaldo_kussama@yahoo.com.br, chestercyoung@yahoo.com
  Subject: Re: problem join
  In-Reply-To: <46AA138D.3070601@yahoo.com.br>

* 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