Forum Discussion
SQL server - joins on multiple columns
- 7 years ago
darylmc As v-chuncz-msft mentioned it is not the right community for this. As this is for Power BI stuff.
Anyway, as I can see in your query that you are trying to join the fields from d (an alias table) which are not present in the SELECT clause. Even though that table might have those fields but you are selection is restricted to the subset of fields and the join performing outside this will know or can access those fields in SELECT statement alone. So you need to have geography_id,calendar_id and merchandising_id in your select statement of d.
Hope this clarifies your issue.
darylmc As v-chuncz-msft mentioned it is not the right community for this. As this is for Power BI stuff.
Anyway, as I can see in your query that you are trying to join the fields from d (an alias table) which are not present in the SELECT clause. Even though that table might have those fields but you are selection is restricted to the subset of fields and the join performing outside this will know or can access those fields in SELECT statement alone. So you need to have geography_id,calendar_id and merchandising_id in your select statement of d.
Hope this clarifies your issue.