Could somebody tell me what is the secret of being able to write a SELECT statement having mulitple LEFT or RIGHT joins, I seem to get in trouble as soon as I add the second LEFT join, as I am obviously doing it wrong.
These are my tables, would somebody mind having a go,or explaining what do i need to be aware of in a case like this
SELECT foo -- to make Rudy happy!
FROM emailDetails AS d
LEFT JOIN emailRecepients AS r
ON (r.emailID_PK = d.emailID_PK)
LEFT JOIN luEmailNotificationTypes AS t
ON (t.emailNOtificationTypeID_PK = d.[emailN otificationTypeID])
The key to the whole process is to ensure that the table with the most detail is the "outermost" table in the JOIN. You can then do LEFT JOIN operations to the other tables without having to go to extrordinary lengths to make them "play nice" together.