MS Access, SQL JOIN syntax for 3-way table join


/ Published in: SQL
Save to your folder(s)

In Microsoft Access, if you want to do more than one LEFT JOIN, you have to use parenthesis in the FROM clause otherwise, you get a "Missing Operator" error.


Copy this code and paste it in your HTML
  1. SELECT a.columna, b.columnb, c.columnc
  2. FROM ((tablea AS a) LEFT JOIN tableb AS b ON a.id = b.id)
  3. LEFT JOIN tablec AS c ON a.id = c.id
  4.  
  5.  
  6. --Or, without the AS syntax...
  7. SELECT tablea.columna, tableb.columnb, tablec.columnc
  8. FROM (tablea LEFT JOIN tableb ON tablea.id = tableb.id)
  9. LEFT JOIN tablec ON tablea.id = tablec.id

URL: http://nm1m.blogspot.com/2007/10/multiple-left-joins-in-ms-access.html

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.