Skip to content
Advertisement

Is there any way to join two queries without common columns

Could anyone help me to join two tables without common columns?

I have two tables:

Tab1

Column1 Column2
K1 a
K2 b

Tab2

Column1 Column2
K3 c
K4 d
K5 e

The result of select should be:

Table1.Column1 Table2.Column1
K1 K3
K1 K4
K1 K5
K2 K3
K2 K4
K2 K5

How do I do that?

Advertisement

Answer

Fiddle -> https://www.db-fiddle.com/f/ihJd4in3Tt7Fr8KZe6UvEC/0

select t1.column1, t2.column1  
from table1 as t1
cross join table2 as t2;
User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement