tags:

views:

27

answers:

1

Hi, 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

+2  A: 
SELECT col1, col2 FROM A
UNION ALL
SELECT col1, col2 FROM B

UNION ALL allows duplicates.

Whereas UNION removes duplicates.

Adam Bernier
Yep but I was asking without UNION (it is in the title :)
Petr
what about without UNION?
Salil
Yes but I am intersted in different method of doing that - without using UNION.
Petr
You can't. You need union to do it in SQL.
Osama ALASSIRY