J
jeremy
Text
Optimising DISTINCT Clauses using EXISTS
Joining a parent table to a child table returns the parent row once for every child row that matches, so a customer with five matching orders comes back five times. Adding DISTINCT hides that, but th…