This introduction to JOINs shows INNER, LEFT, RIGHT, FULL and CROSS JOIN with Venn diagrams and real results from two small tables. It also covers finding rows with no match and three traps that catch people. I first wrote it for members of the Gandhinagar SQL Server User Group.
SQL SERVER – Logical Query Processing Phases – Order of Statement Execution
Logical Query Processing is the order in which SQL Server handles each clause of a statement, with FROM and ON first and SELECT near the end. Here are the phases.
FIFO Inventory Costing in T-SQL: Matching Sales to Purchase Lots
Which purchase lot paid for which sale? Two running totals and one join answer it, with no cursor and no loop.
LEFT JOIN ON Clause: Conditions Decide Matches, Not Rows
Why a condition in ON keeps every customer, why a left-side condition removes nobody, and how one WHERE quietly undoes two LEFT JOINs.
SQL SERVER – INNER JOIN using LEFT JOIN statement – Performance Analysis
Can you write an INNER JOIN using LEFT JOIN? Yes, and the result is the same, but my performance analysis in AdventureWorks shows why you should not.
SQL SERVER – Get Common Records From Two Tables Without Using Join
Sachin wanted common records from two tables without writing a join condition. Imran Mohammed shows how INTERSECT in SQL Server 2005 does it.
Closure Table: Read and Validate Hierarchy Paths
A closure table stores ancestor and descendant paths. Read those relationships efficiently and compare them with the authoritative parent edges.







