• Plesk Uservoice will be deprecated by October. Moving forward, all product feature requests and improvement suggestions will be managed through our new platform Plesk Productboard.
    To continue sharing your ideas and feedback, please visit features.plesk.com

Question INNER JOIN THREE TABLES (SSMS 19)

Ardit

New Pleskian
I have these tables as below :

1). Employees table with Column SuperVisorID
2). Departments table with Column name of Departments (....)

3). Supervisor table with Columns : Name, LastName, SupervisorId .

I have edited in TOP 200 ROWS

How to execute correct way on QUERY SQL SERVER 2019 AT PROGRAM AS BELOW TABLES ??
 
SELECT *
FROM table1 AS a
INNER JOIN table2 AS b ON b.id = a.ref_id
INNER JOIN table3 AS c ON c.id = b.ref_id

or

SELECT *
FROM table1 AS a
INNER JOIN table2 AS b ON b.id = a.ref_id
INNER JOIN table3 AS c ON c.id = a.ref_id

etc. where id is a field in the one table that carries the same value that links to the reference field in the other table as ref_id.
 
Back
Top