Home

MS Access SQL JOIN Multiple Conditional

Joins can be complex. So what if you need to joing AND select where... 

SELECT *
FROM (customers LEFT JOIN users ON (customers.id = who.custid AND who.live = true))
INNER JOIN locations ON customers.id = location.id
WHERE locations.primary = true
 
So we can have a JOIN with table1.id = table2.id AND table2.something = true. For Access at least the multiple join constraints need to be in brackets
 
customers LEFT JOIN users ON (customers.id = who.custid AND who.live = true)

Reader's Comments

Post Your Comment Posts/Links Rules

Name

Comment

Add a RELEVANT link (not required)

Upload an image (not required)

No uploaded image
Real person number
Please enter the above number below




Home
Admin Ren's Biking Blog