Syntax :
Select table1.Column_Name1,table2.Column_Name1
from Table1
Cross join Table2
Consider the following two tables : Salary:
Emp_id | Emp_salary | Emp_desig |
---|---|---|
01 | 25000 | Software Eng |
02 | 30000 | Senior Software Eng |
03 | 25000 | Software Analyst |
Employee_record:
Emp_id | Emp_city | Emp_lastname |
---|---|---|
01 | noida | chauhan |
02 | gurgaon | singh |
Query of cross join:
select *
from salary
cross join Employee_record
Emp_id | Emp_salary | Emp_desig | Emp_id | Emp_city | Emp_lastname |
---|---|---|---|---|---|
01 | 25000 | Software Eng | 01 | noida | chauhan |
01 | 25000 | Software Eng | 02 | gurgaon | singh |
02 | 30000 | Senior Software Eng | 01 | noida | chauhan |
02 | 30000 | Senior Software Eng | 02 | gurgaon | singh |
03 | 25000 | Software Analyst | 01 | noida | chauhan |
03 | 25000 | Software Analyst | 02 | gurgaon | singh |
No comments:
Post a Comment