SQL - Structured Query Language

Cross Join



Cross join is used to retrieve list of all records between parent and child tables. Each parent table's records are associated with each child table's records. No need to define a common column between parent and child tables. The following cross join query is used to retrieve records between DEPT and EMP tables.

-- Example 31 --

 

SELECT EMP.Emp_Code, EMP.Emp_Name, EMP.Dept_Code, DEPT.Dept_Name

FROM EMP

CROSS JOIN DEPT


Query Output Screen



* * * * *


Email Your Comment To AUTHOR