Forum Moderators: open
SELECT L.*, C.*, Address.*
FROM `Loan` AS L LEFT JOIN (
`Customer` AS C
) ON (
L.CustomerID = C.CustomerID
) LEFT JOIN (
`Address` AS Address
) ON (
Address.AddressType='Home' AND Address.CustomerID = L.CustomerID
)
Draw a diagram - it will help you.
Also move "Address.AddressType='Home' " to a WHERE clause from the JOIN clause.
[edited by: FalseDawn at 2:04 am (utc) on Nov. 16, 2006]