some times we may need join mult tables with some criterias...
but when you write a where clause below joins...it will give compile error
so using joins with on parameters will solve the problem
here is a sample query...
SELECT
c.ContactID, c.Name, p.Phone, e.Address
FROM contacts c
LEFT OUTER JOIN email e ON c.ContactID = e.ContactID AND e.type = 'Office'
LEFT OUTER JOIN phone p ON c.ContactID = p.ContactID AND p.type = 'Office'
I hope this helps you
No comments:
Post a Comment