Reputation: 7957
It is probably pretty simple but I cannot figure it out: Say I have tables A and B both with the same columns. I need to do SELECT * FROM A,B without having results merged into one row.
I.e. when each table has 2 rows, I need the result to have 4 rows.
EDIT: I know about JOIN but dont know how to join the tables without predicate. I need merge them.
Thanks
Upvotes: 0
Views: 245
Reputation: 169274
SELECT col1, col2 FROM A
UNION ALL
SELECT col1, col2 FROM B
UNION ALL allows duplicates.
Whereas UNION removes duplicates.
Upvotes: 2