MySQL Forums
Forum List  »  Newbie

Re: new to joins
Posted by: Ramalingam Chelliah
Date: August 31, 2004 04:36AM

Hi,
Check if this helps you...
(Taking Harsha Chaithanya K's assumption of foreign keys)

SELECT X.LastName,Y.LastName,Z.eventcode
FROM
EVENTS as Z
LEFT OUTER JOIN
CONTACTS as X
ON Z.primary_contactID=X.contactID
LEFT OUTER JOIN
CONTACTS as Y
ON Z.secondary_contactID=Y.contactID ;

Regards,
Ram.

P.S:
If primary and secondary contacts are mandatory then use simple "inner join" ( comma separated table list)


We Learn the Most When we have to Invent

Options: ReplyQuote


Subject
Written By
Posted
August 30, 2004 10:03PM
August 31, 2004 02:36AM
Re: new to joins
August 31, 2004 04:36AM
August 31, 2004 09:36AM
September 01, 2004 01:46PM
September 01, 2004 10:52PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.