Skip to content

join on multiple conditions #2330

Closed
@georgi-yakimov

Description

@georgi-yakimov

hi,

I've run into the following problem when trying to do a join on multiple columns:

select Id, col, fk_t2
from dbo.table1 t1
left outer join dbo.table2 t2 on t1.fk_t2 = t2.Id and t2.col = t1.col
where <filtering>

but the output is:

select Id, col, fk_t2
from dbo.table1 t1
left outer join dbo.table2 t2 on t1.fk_t2 = t2.Id and t2.col = t1_1.col
where <filtering>

The problem is that when there's inheritance join with a withClause and the column which is used in the withClause is present in the base and the inherited table the condition is not generated correctly. The table that is considered in the with clause is from the base table which is not yet joined.

I've checked the code and I think I've found a solution. Can you give me privileges to create a topic branch?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions