Is it possible to write single query on two table which are not connected to each other?

A Cartesian join (note there is no JOIN condition). All possible combinations of records are in the results:

tableA (charfield Char(2))
tableB (numberfield Number(1))

INSERT 'A' INTO tableA;
INSERT 'B' INTO tableA;
INSERT 1 INTO tableB;
INSERT 2 INTO tableB;

SELECT * 
FROM   tablea CROSS JOIN tableb

Results:

charfield|numberfield
=====================
A        |1
A        |2
B        |1
B        |2    

Leave a Comment