mysql - Outer join giving same results as inner join if using where clause -
mysql - Outer join giving same results as inner join if using where clause -
the next sql statement:
select * employees e left bring together departments d on e.deptid = d.deptid ( d.deptname = 'hr' or d.deptname = 'hr & accounts')
produces same results next inner join:
select * employees e inner bring together departments d on e.deptid = d.deptid , d.deptname '%hr%';
in way produce same result.
i mean first query equivalent e.g. of:
select * employees , filter using where do left join?what steps of first query create same inner join?
for rows don't match status of outer join, value of column in joined table null. clause happens (conceptually) after joins processed, status testing columns false (or, strictly speaking, null).
if want include rows 1 table, match rows in sec table meet condition, have add together status on clause of outer join.
also, note because inner bring together discards rows there no match, status in on clause of inner bring together has same effect if in clause.
mysql sql join left-join inner-join
Comments
Post a Comment