CROSS APPLY aggregate behavior depends on whether the right-side query actually produces a row. I inspect that query before assuming unmatched customers disappear. An aggregate without GROUP BY can return a row even when its input is empty.
Relational Division in T-SQL: Customers Who Bought Every Product
Solve relational division with counts and double NOT EXISTS, then handle duplicates, NULL values, empty requirements, and exact matching.
SQLAuthority News – 2 Sessions at TechInsight 2010 – June 29 – July 1, 2010
I presented two sessions at TechInsight 2010 in Kuala Lumpur, Malaysia, from June 29 to July 1, 2010. The best part of the trip was the people and their response.
SQL SERVER – The Self Join – Inner Join and Outer Join
Is a Self Join an inner join or an outer join? It can be either. I build a small new example that shows Self Join as inner join and outer join.
SQL SERVER – Outer Join Not Allowed in Indexed Views
Why is OUTER JOIN not allowed in indexed views? A reader was confused by the white paper answer, so I explain it with an example and ask for yours.
SQL SERVER – Default Statistics on Column – Automatic Statistics on Column
Does a column need an index to have statistics? No. A quick demo shows automatic statistics on column data when AUTO_CREATE_STATISTICS is on.
SQL SERVER – MERGE Insert Update and Delete with an Isolated Example
Merge Operations can combine conditional inserts, updates and deletes. I inspect the plan before making any claim about scans or speed.






