Search notes:

Access: joins

Joining multiple tables

Access requires parentheses to join more then two tables. In fact, in order to join n tables, n-2 pairs of parentheses are needed.
select
  … 
from  (((
   table_one    t1                           inner join
   table_two    t2 on t2.one_id    = t1.id ) inner join
   table_three  t3 on t3.two_id    = t2.id ) inner join
   table_four   t4 on t4.three_id  = t3.id ) inner join
   table_five   t5 on t5.four_id   = t4.id
where
   …
;

Outer joins

If a condition is applied to the outer-joined table, the condition must be put into parentheses:
select
   …
from
   table_one    t1                                               left outer join
   table_two    t2 on ( t1.id = t2.id and t2.criteria = 'xyz' )

Maximum number of tables

The maximum number of tables that can be joined is 16 (as of MS-Access 2019).

See also

Access SQL: select statements

Index

Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 8 attempt to write a readonly database in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php:78 Stack trace: #0 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(78): PDOStatement->execute(Array) #1 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(30): insert_webrequest_('/notes/developm...', 1759406530, '216.73.216.42', 'Mozilla/5.0 App...', NULL) #2 /home/httpd/vhosts/renenyffenegger.ch/httpsdocs/notes/development/databases/Access/SQL/select/join/index(67): insert_webrequest() #3 {main} thrown in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php on line 78