pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jeff Patterson <jpat@mpip.org>
To: pgsql-general@postgresql.org
Subject: query help
Date: Fri, 07 Sep 2001 08:09:21 -0700
Message-ID: <3B98E321.BD925DA2@mpip.org> (raw)
References: <200109070443.f874h7D27286@candle.pha.pa.us>

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






view thread (70+ messages)  latest in thread

Message-ID: <3B98E321.BD925DA2@mpip.org>
Permalink:  ../3B98E321.BD925DA2@mpip.org/
Also on:    postgresql.org/message-id/3B98E321.BD925DA2@mpip.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: jpat@mpip.org
  Subject: Re: query help
  In-Reply-To: <3B98E321.BD925DA2@mpip.org>
  References: <200109070443.f874h7D27286@candle.pha.pa.us> <3B98E321.BD925DA2@mpip.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox