Tell Me
 

Joining Multiple Tables

Previous previous|next Next Page

A three-way join is a join of three tables. You can join as many tables as needed to retrieve information. For example, you might want to find employees, their employment history, and the department names for those employees. This requires accessing three tables:- EMP, EMPHIST, and DEPT.

In the FROM clause, you identify the tables you want to join.

FROM table1

JOIN table2 ON conditon_x

JOIN table3 ON condition_y

          
SELECT * FROM EMPLOYEES E, JOB_HISTORY JH,

DEPARTMENTS D WHERE E.EMPLOYEE_ID = JH.EMPLOYEE_ID

AND D.DEPARTMENT_ID = JH.DEPARTMENT_ID

          

          

Write SQL which shows employment history of employee Jonathon Taylor