Re: SQL help... - Mailing list pgsql-general

From Harald Fuchs
Subject Re: SQL help...
Date
Msg-id y297kzh1rae.fsf@dorando.intern.colibri.de
Whole thread Raw
In response to SQL help...  (Alex Hochberger <alex@feratech.com>)
List pgsql-general
In article <1F3774AB3688D4118B1300508BD9641528A7E0@CHINA>,
Alex Hochberger <alex@feratech.com> writes:

> 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...

Sounds like a LEFT OUTER JOIN.

pgsql-general by date:

Previous
From: Roberto Mello
Date:
Subject: Re: [HACKERS] Internet is putting lot of competition fire & heat under Microsoft SQL Server
Next
From: "Steve O'Hagan"
Date:
Subject: Re: Re: Internet is putting lot of competition fire & heat under Microsoft SQL Server