From: | Osvaldo Rosario Kussama <osvaldo_kussama(at)yahoo(dot)com(dot)br> |
---|---|
To: | chester c young <chestercyoung(at)yahoo(dot)com> |
Cc: | sql pgsql <pgsql-sql(at)postgresql(dot)org> |
Subject: | Re: problem join |
Date: | 2007-07-27 15:47:25 |
Message-ID: | 46AA138D.3070601@yahoo.com.br |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-sql |
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
From | Date | Subject | |
---|---|---|---|
Next Message | Carol Cheung | 2007-07-27 19:05:16 | group by range of values |
Previous Message | Merlin Moncure | 2007-07-27 13:38:45 | Re: Tunning PostgreSQL performance for views on Windows |