Left Outer join and an additional where clause

前端 未结 5 981
南方客
南方客 2020-12-18 18:05

I have a join on two tables defined as a left outer join so that all records are returned from the left hand table even if they don\'t have a record in the right hand table.

5条回答
  •  别那么骄傲
    2020-12-18 18:22

    You just need to put the predicate into the JOIN condition. Putting it into the WHERE clause would effectively convert your query to an inner join.

    For Example:

    ...
    From a
    Left Join b on a.id = b.id and b.condition = 'x'
    

提交回复
热议问题