zanzoken
zanzoken

Reputation: 897

sql access inner join of 4 tables

I am new to sql and I am trying to join 4 tables together but just cant get the hang of it. I am trying to do this with an inner join but I always get an syntax error with access.

SELECT * 
from kdst,aufpos 
inner join( artst inner join vert on kdst.vertreter = vert.vertnr)
on aufpos.artnr = artst.artnr;

This is my code but it does not work. I dont know what to do anymore, I hope someone can help me.

Upvotes: 0

Views: 4443

Answers (2)

jn29098
jn29098

Reputation: 1415

Select * 
From table1 t1
Inner join table2 t2 on t1.id = t2.fkid
Inner join table3 t3 on t1.id = t3.fkid
...

This is if you want to join multiple tables to the same parent table (table1). Fkid is the column of the foreign key field that refers to the primary key of the parent table.

Upvotes: 0

Fionnuala
Fionnuala

Reputation: 91376

Build using the query design window

access query design window

Then switch to sql view

sql view

Upvotes: 3

Related Questions