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
views:
27answers:
1
+2
A:
SELECT col1, col2 FROM A
UNION ALL
SELECT col1, col2 FROM B
UNION ALL allows duplicates.
Whereas UNION removes duplicates.
Adam Bernier
2010-05-26 06:28:37
Yep but I was asking without UNION (it is in the title :)
Petr
2010-05-26 06:29:35
what about without UNION?
Salil
2010-05-26 06:29:46
Yes but I am intersted in different method of doing that - without using UNION.
Petr
2010-05-26 06:32:28
You can't. You need union to do it in SQL.
Osama ALASSIRY
2010-05-26 06:33:35