From: Chris Jewell <vs0u8055@liv.ac.uk>
To: pgsql-sql@postgresql.org
Subject: Problem with a lookup table! Please help.
Date: Mon, 9 Dec 2002 20:58:12 -0000
Message-ID: <000f01c29fc5$afc34960$2301a8c0@chrisdomain> (raw)
Hi,
In my capacity as a vet student, I'm trying to create a database of antibiotics. The way that I have set it up so far is to have one main table listing the antibiotics versus their respective efficacies against the four major groups of bacteria. Due to the way that my PHP frontend works, I have assigned a number to the efficacy - 1 being excellent and 5 being poor efficacy against the particular bacterium. However, I now want to have a new table which converts numbers into words. The problem is this, if I join the main table with the "translation" lookup table, the column names for each of the four categories in the main default to the column name in the lookup table and hence are all the same. What SQL expression should I use to translate the cryptic numbers into plain english whilst preserving the column headings in the main table?
Regards,
Chris J
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 using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: vs0u8055@liv.ac.uk
Subject: Re: Problem with a lookup table! Please help.
In-Reply-To: <000f01c29fc5$afc34960$2301a8c0@chrisdomain>
* 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