Skip site navigation (1) Skip section navigation (2)

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search for
  Advanced Search

Re: problem join



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




Home | Main Index | Thread Index

Privacy Policy | PostgreSQL Archives hosted by Command Prompt, Inc. | Designed by tinysofa
Copyright © 1996 – 2008 PostgreSQL Global Development Group