SQL tutorial | Interview questions | Oracle
Would you like to react to this message? Create an account in a few clicks or log in to continue.

How To Write an Inner Join with the WHERE Clause?

Go down

How To Write an Inner Join with the WHERE Clause? Empty How To Write an Inner Join with the WHERE Clause?

Post by Micheal Sun Jan 17, 2010 3:14 am

If you don't want to use the INNER JOIN ... ON clause to write an inner join, you can put the join
condition in the WHERE clause as shown in the following query example:
SQL> SELECT d.department_name, e.first_name, e.last_name
FROM departments d, employees e
WHERE d.manager_id = e.employee_id;
DEPARTMENT_NAME FIRST_NAME LAST_NAME
-------------------- ------------------------- ------------------
Administration Jennifer Whalen
Marketing Michael Hartstein
Purchasing Den Raphaely
Human Resources Susan Mavris
Shipping Adam Fripp
IT Alexander Hunold

Micheal
Admin

Posts : 243
Join date : 2010-01-10

http://sql-tutorial.co.cc

Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum