I need to generate sql query for the following case :
FirstTable
|column1|
|-------|
|A |
|B |
SecondTable
|column2|
|-------|
|1 |
|2 |
|3 |
|4 |
I want to create query so the result will be like this :
ResultTable
|column1|column2|
|-------|-------|
|A |1 |
|A |2 |
|A |3 |
|A |4 |
|B |1 |
|B |2 |
|B |3 |
|B |4 |
Appreciate any answer, thank you.
>Solution :
Use a cross join between the two tables:
SELECT t1.column1, t2.column2
FROM FirstTable t1
CROSS JOIN SecondTable t2
ORDER BY t1.column1, t2.column2;