Last active
October 18, 2021 19:24
-
-
Save vvgsrk/dc2cdec2778a9069ed2822affb62d0ef to your computer and use it in GitHub Desktop.
Joining More than Two Tables
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Joining more than two tables with JOIN and ON keywords | |
SELECT e.last_name, d.department_name, l.city | |
FROM employees e JOIN departments d | |
ON (e.department_id = d.department_id) | |
JOIN locations l | |
ON (d.location_id = l.location_id); | |
-- Joining more than two tables with equal (=) operator | |
SELECT e.last_name, d.department_name, l.city | |
FROM employees e, departments d, locations l | |
WHERE e.department_id = d.department_id | |
AND d.location_id = l.location_id; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment