Received: from marine.sonic.net (marine.sonic.net [208.201.224.37]) by postgresql.org (8.11.3/8.11.4) with SMTP id f87Fhe735243 for ; Fri, 7 Sep 2001 11:43:40 -0400 (EDT) (envelope-from jpat@sonic.net) Received: (qmail 127 invoked from network); 7 Sep 2001 15:43:35 -0000 Received: from bolt.sonic.net (HELO sonic.net) (208.201.224.36) by marine.sonic.net with SMTP; 7 Sep 2001 15:43:35 -0000 Received: (from jpat@localhost) by sonic.net (8.11.6/8.7.3) id f87FhNI29963 for pgsql-general@postgresql.org; Fri, 7 Sep 2001 08:43:23 -0700 From: Jeff Patterson Message-Id: <200109071543.f87FhNI29963@sonic.net> Subject: query help To: pgsql-general@postgresql.org Date: Fri, 7 Sep 2001 08:43:23 -0700 (PDT) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Archive-Number: 200109/207 X-Sequence-Number: 14836 This seems like such a basic function that I'm sure I am missing something fundamental. I have a table, say xref, whose columns are primary key values for other tables. Some of theses keys may be NULL for a given row in xref. I want to create a query that returns the corresponding entries in the other tables. xref: drug_id | function_id|syst_id |text_id -------------------------------------- d0001 | 2 | 3 | 3423 d0001 | 5 | | 5678 d0056 | 3 | 5 | system_id: syst_id | syst_desc ------------------- 3 | renal 4 | hepatic 5 | respiratory clinical_text: text_id| clinical_text ----------------------------------- 3423 | 'some medical mumbo jumbo' 5678 | 'more of the same' I want the syst_desc and clinical_text (plus other similar data from tables not shown) given a drug_id and function_id. Any help? Thanks a bunch, Jeff Patterson The Melanoma Patients' Information Page http://www.mpip.org -- Jeff Patterson Site Administrator The Melanoma Patients' Information Page http://www.mpip.org/