Difference between revisions of "Cartesian Join or Cross Join"

From rbachwiki
Jump to navigation Jump to search
(Created page with " '''In a Cartesian join, also called a Cartesian product or cross join, each record in the first''' '''table is matched with each record in the second table. This type of join...")
 
Line 7: Line 7:
'''first table is matched with each of the four records from the second table, and so on.'''
'''first table is matched with each of the four records from the second table, and so on.'''


SELECT isbn, title, location, ' ' Count
FROM books, warehouses
ORDER BY location, title;


 
SELECT isbn, title, location, ' ' Count
 
FROM books CROSS JOIN warehouses
ORDER BY location, title;


[[#Select Command|Back To Top]]-[[Main_Page| Home]] - [[Oracle_SQL|Category]]
[[#Select Command|Back To Top]]-[[Main_Page| Home]] - [[Oracle_SQL|Category]]

Revision as of 18:27, 22 October 2017

In a Cartesian join, also called a Cartesian product or cross join, each record in the first table is matched with each record in the second table. This type of join is useful when you’re performing certain statistical procedures for data analysis. Therefore, if you have three records in the first table and four in the second table, the first record from the first table is matched with each of the four records in the second table. Then the second record of the first table is matched with each of the four records from the second table, and so on.

SELECT isbn, title, location, ' ' Count
FROM books, warehouses
ORDER BY location, title;
SELECT isbn, title, location, ' ' Count
FROM books CROSS JOIN warehouses
ORDER BY location, title;

Back To Top- Home - Category