CROSS -JOIN

It is also known as CROSS PRODUCT OR CARTESIAN PRODUCT because it produces the product of multiple tables. Every row from first table is multiplied with all rows of another table. Simply it is the multiplication of two tables.

Syntax: SELECT TABLE1.COLUMN1,TABLE1.COLUMN2,.....TABLE2.COLUMN1,TABLE2.COLUMN2,....FROM TABLE1,TABLE2

Note:Now I want multiply EMP table with EMP table.

Select * from DEPT,DEPT

The above statement shows an error message because it not possible to multiply a table by itself with the same name,so that we to project the same table DEPT as two tables to the Sql Server. To show a single DEPT table as two tables to server we have to use the concept of table Alias Names.
Share/Bookmark

No comments: