Sorry that this is not a MySQL question per se, but
I've tried the "SQL" forums and haven't received a
reply.  Hopefully someone on this list can see what
I'm trying to do and provide an answer, taking maybe a
minute of their time.  It would mean a lot to me.

Question:

How can I get two child tables to left join (or the
equivalent action if there is a workaround) to a
parent table?  I'd like the tables "DomesticAddresses"
and the table aliased as "DomAdd" to do the equivalent
of a LEFT JOIN to the table "OrgID2DomAdds".

Example SELECT statement:

SELECT DISTINCT
Orgs.organizationID AS org_orgID,
Orgs.organizationName AS org_orgName,
OrgID2DomAdds.organizationID AS 2domAdd_orgID,
DomesticAddresses.domesticAddressID AS
domAdd_domAddID,
DomesticAddresses.domesticAddressZipCode AS zipCode1,
DomAdd.domesticAddressZipCode AS zipCode2
FROM 
Orgs
LEFT JOIN OrgID2DomAdds
ON Orgs.organizationID = OrgID2DomAdds.organizationID
LEFT JOIN DomesticAddresses
ON OrgID2DomAdds.domesticAddress1ID =
DomesticAddresses.domesticAddressID
LEFT JOIN DomesticAddresses AS DomAdd
ON OrgID2DomAdds.domesticAddress1ID =
DomesticAddresses.domesticAddressID
WHERE Orgs.organizationID = 1
OR Orgs.organizationID = 3;

Thanks for any assistance that someone can provide.


__________________________________________________
Do you Yahoo!?
Yahoo! Platinum - Watch CBS' NCAA March Madness, live on your desktop!
http://platinum.yahoo.com

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to