On Fri, 1999-08-20 10:27:31 -0400, Wayne Spivak wrote:
> I have a table called addresses. It contains four fields for Area,
> (called area, area_1, so on).
> I have another table called Area, which contains two fields, areano
> & areaname.
> My problem is how do I produce output substituting the areaname for
> each area. (I can do one without a problem - not rocket science
SELECT t0.areaname AS areaname,
, t1.areaname AS areaname_1,
, t2.areaname AS areaname_2,
, t3.areaname AS areaname_3
FROM addresses AS a
, Area AS t0
, Area AS t1
, Area AS t2
, Area AS t3
WHERE a.area = t0.areano
AND a.area_1 = t1.areano
AND a.area_2 = t2.areano
AND a.area_3 = t3.areano
This should do it, I hope (typed off the cuff).
Martin Ramsch <m.ramsch@stripped> <URL: http://home.pages.de/~ramsch/ >
PGP KeyID=0xE8EF4F75 FiPr=52 44 5E F3 B0 B1 38 26 E4 EC 80 58 7B 31 3A D7