so you want a list of proucts and both manufacturers? try a double join.
(please note. this assumes that there are always values for both ManID and
RealManID. if they are not always populated, make the joins OUTER and
you'll be good.)
SELECT
p.pid,
p.<columns from products>,
m1.manname,
m2.manname
FROM
products p,
manufacturers m1,
manufacturers m2
WHERE
p.manid = m1.manid AND
p.realmanid = m2.manid
chris olive, cio
cresco technologies
[EMAIL PROTECTED]
http://www.crescotech.com
-----Original Message-----
From: Duane Boudreau [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 31, 2001 10:24 AM
To: CF-Talk
Subject: DB Query
I have a couple of tables I am working with that do not have very good
PK/FKs setup.
(Unfortunately this is not my schema and I don't have the luxury of changing
it)
1) Manufactures [ManID, ManName, ....]
2) Products [PID, ManID, RealManID ]
ManID and RealManID map to MID and usually contain differing values. I need
(hopefully) in one query to extract both the Real Manufacturer Name and the
other Manufacturer Name.
Duane
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists