Skip to content

Instantly share code, notes, and snippets.

@vvgsrk
Last active October 18, 2021 19:21
Show Gist options
  • Save vvgsrk/c993e9b2311d55df876176d2bccffaec to your computer and use it in GitHub Desktop.
Save vvgsrk/c993e9b2311d55df876176d2bccffaec to your computer and use it in GitHub Desktop.
Generating a Cartesian Product
-- Cartesian product
SELECT employee_id, first_name || last_name full_name, job_id, department_name
FROM employees, departments;
-- Cartesian product with CROSS JOIN syntax
SELECT last_name, department_name
FROM employees CROSS JOIN departments;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment