Tuesday, December 9, 2008

Cross join in oracle

Cross join is very similar to many – to – many relations.
Joining tables with out any condition results to cross join.






If we consider cross join between these 2 tables then,







We have totally 6 rows as result set.
(3 rows from table 1, each joining to each (2 rows) in table 2).
(3 * 2)

Query:-
select tab1.*,tab2.* from tab1,tab2

We can observe from the above query there is no join condition, which means the execution plan takes each row in tab1 table joining to each row in tab 2.

No comments: