Oracle 11g Joins and Subqueries

Convert a subquery to a join in Oracle 11g

SELECT first_name, department_id
FROM employees
WHERE department_id IN (SELECT department_id
FROM departments
WHERE LOCATION_ID = 1700)

Answer:

SELECT first_name, department_id, location_id
FROM employees JOIN departments USING (department_id)
WHERE location_id = 1700;

Winner: Ambuj

Leave a Reply