Received: from postgresql.org.org (webmail.postgresql.org [216.126.85.28]) by postgresql.org (8.11.3/8.11.1) with SMTP id f4ICp0A38735 for ; Fri, 18 May 2001 08:51:00 -0400 (EDT) (envelope-from pgsql-general-owner@postgresql.org) Received: from mailrelay.planNET.de (mailrelay.planNET.de [212.126.200.57]) by postgresql.org (8.11.3/8.11.1) with ESMTP id f4GBD2A21709 for ; Wed, 16 May 2001 07:13:02 -0400 (EDT) (envelope-from news@srv.colibri.de) Received: from srv.colibri.de ([212.126.219.129]) by mailrelay.planNET.de with esmtp (Exim 3.22 #1) id 14zzEh-0004CC-00 for pgsql-general@postgresql.org; Wed, 16 May 2001 13:12:59 +0200 Received: by srv.colibri.de (Colibri, from userid 9) id 5CDE22C6A3; Wed, 16 May 2001 13:11:35 +0200 (CEST) From: Harald Fuchs X-Newsgroups: local.pgsql.general Subject: Re: SQL help... Date: 16 May 2001 13:12:25 +0200 Organization: Colibri GmbH, Karlsruhe, Germany Lines: 22 Message-ID: References: <1F3774AB3688D4118B1300508BD9641528A7E0@CHINA> Mime-Version: 1.0 (generated by tm-edit 7.90) Content-Type: text/plain; charset=US-ASCII X-Trace: pylos.colibri.de 990011494 11410 10.20.0.13 (16 May 2001 11:11:34 GMT) X-Complaints-To: news@colibri.de X-PGP-Fingerprint: 09 4E C4 A2 B2 C5 33 1A 79 80 5D 39 BD 9B 89 39 X-Face: ''^H\OFg4p=JCbj; 8; wPg7&J)-x28+)N1nU7\39|F,H&xAzd{TK"_BU%^~K?8u)Cg; y+MMA D#g)B@w7lZzB"?-L?r'+ct{^A|c}S,%Qc~]yKjlttQ8YMU"LK!; z7M?P}Sia!(S()Aw|)+k0Ud/h{K :rD_VY6%mT^J6Zf}3G4yNv$:46CkTO*e86l, Alex Hochberger 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.