X-Original-To: pgsql-sql@postgresql.org Received: from localhost (unknown [64.117.224.193]) by developer.postgresql.org (Postfix) with ESMTP id ECD8E924FE9 for ; Tue, 20 May 2003 12:00:17 -0400 (EDT) Received: from developer.postgresql.org ([64.117.224.193]) by localhost (developer.postgresql.org [64.117.224.193:10024]) (amavisd-new) with ESMTP id 97157-04 for ; Tue, 20 May 2003 12:00:14 -0400 (EDT) Received: from web41803.mail.yahoo.com (web41803.mail.yahoo.com [66.218.93.137]) by developer.postgresql.org (Postfix) with SMTP id 3525D924FEF for ; Tue, 20 May 2003 12:00:13 -0400 (EDT) Message-ID: <20030520160011.81254.qmail@web41803.mail.yahoo.com> Received: from [129.6.154.168] by web41803.mail.yahoo.com via HTTP; Tue, 20 May 2003 09:00:11 PDT Date: Tue, 20 May 2003 09:00:11 -0700 (PDT) From: ww zz Subject: how to do this query? To: pgsql-sql@postgresql.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Scanned: by amavisd-new X-Archive-Number: 200305/385 X-Sequence-Number: 13550 New to sql and may be a simple question for you: I have four tables sample: sid, sname make: sid, mdate measure: sid, mdate, rid result: rid, resultdata for a gaven sample it always has a sid and sname, but it may or may not have any entries in the other tables, the sample could be measured more than once and each measure give a result row. question: how do I do a query that given a sid, it will retrieve all the information available in the four tables, if there are available. If, for example, all tables have some entry for a gave sample it will retreve all the information, if the "measure" and "result" are empty for that sample it will give only the 'sample' and 'make' information.... please help Thanks __________________________________ Do you Yahoo!? The New Yahoo! Search - Faster. Easier. Bingo. http://search.yahoo.com