SQL help...

From: Alex Hochberger <alex(at)feratech(dot)com>
To: "'pgsql-general(at)postgresql(dot)org'" <pgsql-general(at)postgresql(dot)org>
Subject: SQL help...
Date: 2001-05-16 04:15:47
Message-ID: 1F3774AB3688D4118B1300508BD9641528A7E0@CHINA
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

To any SQL wizards out there,

I have finally exhausted my SQL knowledge.

I have 3 tables that I need to do a fancy join on...

1 stores the users
1 stores the questions
1 stores the user's answers to the questions (based on foreign keys to the
answers table)

I would like to create a result with the following columns:
some fields from the users, each of the questions

in each row should be the results from the users, and their user answers

Here is the tricky thing, people may have not answered each question, so I
would like to either leave that blank or put in a 0...

With an ugly hack, I get the results where they answered everything, but not
the partial answers.

Please cc: me on the reply, because I get this as a digest.

Thanks,
Alex

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Alex Hochberger 2001-05-16 04:28:40 RE: SQL help...
Previous Message Per-Olof Pettersson 2001-05-16 03:40:40 Re: Not a PG question: SCSI question