Skip to content

Instantly share code, notes, and snippets.

@vvgsrk
Last active October 18, 2021 19:23
Show Gist options
  • Save vvgsrk/d319d1ce728c37d1681fd86a6b942467 to your computer and use it in GitHub Desktop.
Save vvgsrk/d319d1ce728c37d1681fd86a6b942467 to your computer and use it in GitHub Desktop.
Generate_Inner_Join
-- Inner Join with the ON Clause
SELECT e.employee_id, e.last_name, e.department_id, d.department_id, d.location_id
FROM employees e JOIN departments d
ON (e.department_id = d.department_id);
-- Inner Join with the Equal (=) Operator
SELECT e.employee_id, e.last_name, e.department_id, d.department_id, d.location_id
FROM employees e, departments d
WHERE e.department_id = d.department_id;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment