Cross Join:
The Cross Join command helps to Join two Two table by a Cartesian method. Means that number of rows in the first table will get multiplied with the number of Rows in the Second table.
The Cartesian method can be understood by taking two sets A= {5,2,6} and B={1,2} .Then The Cartesian Product obtained will be A*B ={(5,1),(5,2),(2,1),(2,2),(6,1),(6,2) }
In this way, the two table will get merge together to produce a set of desired result.
Syntax :
SELECT * FROM table1 CROSS JOIN table2;
Lets consider two table foods and company in which Cross Join Operation Is Applied as
SELECT foods.item_name,foods.item_unit,
company.company_name,company.company_city
FROM foods
CROSS JOIN company;
0 Comment(s)