Sunday, September 25, 2016

what is a cross join ?

Sql cross join come with the result multiplied by the second table.cross join is a Cartesian product.


Table 1 name Customer













Table 2 name CustomerOrder












Query:                
SELECT TOP 1000 [CustomerID] ,[FirstName] ,[MiddleName] ,[OrderDate],[ProductId]             
FROM [Inventory].[dbo].[Customer]cross join[Inventory].[dbo].[CustomerOrder]















Sql cross join  here two table row * row result come here table1  row 2 and table 2 row 8 .   total 16.                                                                    

No comments:

Post a Comment