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

Popular posts from this blog

networking - Vagrant-provisioned VirtualBox VM is not reachable from Ubuntu host -

c# - ASP.NET Core - There is already an object named 'AspNetRoles' in the database -

ruby on rails - ArgumentError: Missing host to link to! Please provide the :host parameter, set default_url_options[:host], or set :only_path to true -