Skip to content
Advertisement

SQL – Add in a new table join when all left join – Total beginner [closed]

I need help with adding in an additional join to my query.

All the tables are currently left outer joined from SO_Header however there is also some data I need from a table called RANGE which only links to the MODEL table.

How can I edit my script to bring in the RANGE table?

I’m using the get data from microsoft query in Excel.

Extract from my script:

Advertisement

Answer

Assuming you have a foreign key in your range table with named RANGE_MODEL_Code then you can join model and range like this

Also you can change the way you wants to join the table (i-e let join, inner join or outer join) depends on your business requirement

Change your table name and joining keys from both table i-e RANGE_MODEL_Code and MODEL_Code according to your schema

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement