UNION vs UNION ALL

UNION The UNION command combines the result set of two or more SELECT statements (only distinct values). UNION ALL The UNION ALL command combines the result set of two or more SELECT statements (allows duplicate values).

Cross Join

The CROSS JOIN joined every row from the first table (T1) with every row from the second table (T2). In other words, the cross join returns a Cartesian product of rows from both tables. In general, if the first table has n rows and the second table has m rows, the cross join will result in n... » read more