Multiset difference removes matching occurrences while keeping any extra copies from the left input. I assign occurrence numbers before pairing rows. A value’s presence on the right should not automatically remove every left copy.
SQL SERVER – Correlated and Noncorrelated – SubQuery Introduction, Explanation and Example
What is the difference between correlated and noncorrelated subqueries? I explain both kinds with simple AdventureWorks examples.
SQL SERVER – 2005 – Use Always Outer Join Clause instead of (*= and =*)
My friend’s queries failed in SQL Server 2005 because they used *= and =* for joins. Always use the LEFT or RIGHT outer join clause instead.
GROUP BY Done Right
GROUP BY Done Right separates row filters from group filters, handles NULL groups, and avoids totals inflated by careless joins.
Replacing a Cursor With a Set-Based Query
Replacing a cursor with one set-based update can simplify row processing; this worked example shows correctness checks and fair timing.
SQL SERVER – Explanation SQL SERVER Hash Join
How a Hash Join works in two phases, build and probe, why it suits large data sets without indexes, and why it needs an equijoin predicate.







