We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ebfc04b commit a69c9efCopy full SHA for a69c9ef
1 file changed
Advanced SQL Puzzles/Advanced SQL Puzzles Solutions.sql
@@ -2985,7 +2985,7 @@ FROM #ProductsA a FULL OUTER JOIN
2985
SELECT 'Matches in both table A and table B' AS [Type],
2986
ProductNameA
2987
FROM cte_FullOuter
2988
-WHERE ProductNameA = ProductNameB
+WHERE ProductNameA = ProductNameB AND QuantityA = QuantityB
2989
UNION
2990
SELECT 'Product does not exist in table B' AS [Type],
2991
@@ -3000,7 +3000,7 @@ UNION
3000
SELECT 'Quantities in table A and table B do not match' AS [Type],
3001
3002
3003
-WHERE QuantityA <> QuantityB;
+WHERE ProductNameA = ProductNameB AND QuantityA <> QuantityB;
3004
GO
3005
3006
/*----------------------------------------------------
0 commit comments