mysql - Left Join with Null Script Efficiency Explanation Needed -
why use left join
in sql in from
clause , attach where
clause entity "is null"? told efficient script , should learn methodology behind it.
for example:
from left join arow , brow b , crow c , drow d brow.b null;
this kind of construct used when want know "a list of customers have never ordered anything" :
select customer.* customers left join orders on orders.customerid = customers.id orders.id null
or quote old manager of mine: "can database give me list of isn't in database?"
me> "sure, can give me list of things database should tell doesn't have?"
him> "how supposed know that?"
Comments
Post a Comment