over 9 years ago
SQL Cross means cartesian product of the rows of two or more tables . It return all the rows of the table when each row of the first table combined with the each row of the second table . It is also known as cartesian or cross join .
Cross Join can be represent by two ways :
1) Using Join Syntax .
2) from clause without using a where clause .
Syntax :
Example of Cross join :
First Table name : Employee_Info
Second Table name : student
Query for Cross Join :
Output :
- Employee_Id Employee_name Employee_Age Student_name Student_Age
- 1 Mukesh 23 Abhishek 26
- 2 Ayush 24 Abhishek 26
- 1 Mukesh 23 Ravi 25
- 2 Ayush 24 Ravi 25
Employee_Id Employee_name Employee_Age Student_name Student_Age 1 Mukesh 23 Abhishek 26 2 Ayush 24 Abhishek 26 1 Mukesh 23 Ravi 25 2 Ayush 24 Ravi 25
0 Comment(s)