Reputation: 7
hello i am having trouble with this join, can someone help? still new so thank you for the recommendations
i'm going to try to explain what i am wanting to accomplish, forgive me if i don't make sense. i have 4 tables that all have some sort of information, but cannot create a join to bring only what i need. the tables below have the data and the bold is what i need from them to create the output.
here is what i have
select
table1.name as name,
table1.manager as manager,
table2.ID,
from table1
left join table2 on table1.ID=table2.ID
JOIN (table3 INNER JOIN table4 ON table3.date = table4.hire_date) ON table1.name = table3.name ```
name manager ID date hired
jack frost cinderalla 75654 5/1/2020
tooth fairy snow white 6542 6/1/2019
Upvotes: 0
Views: 65
Reputation: 2918
table name can not use as column I think here's error
select
table1.name as name,
table2.name as manager_name,
table3.employee_ID
from table1
left join table2 on table1.name=table2.name
left join table3 on table1.name=table3.name
JOIN (table4 INNER JOIN table5 ON table4.table4_name = table5.table5_name) as table5 ON table1.name = table5.table5_name
Upvotes: 1