DECLARE @a table(i int)
DECLARE @b table(i int)
INSERT INTO @a SELECT 1 UNION ALL SELECT 2
INSERT INTO @b SELECT 1 UNION ALL SELECT 3
SELECT a.i,b.i FROM @a AS a INNER JOIN @b AS b ON a.i =b.i
SELECT a.i,b.i FROM @a AS a LEFT JOIN @b AS b ON a.i =b.i
SELECT a.i,b.i FROM @a AS a RIGHT JOIN @b AS b ON a.i =b.i
SELECT a.i,b.i FROM @a AS a FULL JOIN @b AS b ON a.i =b.i
DECLARE @b table(i int)
INSERT INTO @a SELECT 1 UNION ALL SELECT 2
INSERT INTO @b SELECT 1 UNION ALL SELECT 3
SELECT a.i,b.i FROM @a AS a INNER JOIN @b AS b ON a.i =b.i
SELECT a.i,b.i FROM @a AS a LEFT JOIN @b AS b ON a.i =b.i
SELECT a.i,b.i FROM @a AS a RIGHT JOIN @b AS b ON a.i =b.i
SELECT a.i,b.i FROM @a AS a FULL JOIN @b AS b ON a.i =b.i