4 ms·
As someone who only works now and then with Postgres, this is what made it click for me: "Loosely, it means that a LATERAL join is like a SQL foreach loop, in
by MrBuddyCasino 12y ago
As someone who only works now and then with Postgres, this is what made it click for me:
"Loosely, it means that a LATERAL join is like a SQL foreach loop, in which PostgreSQL will iterate over each row in a result set and evaluate a subquery using that row as a parameter."
- ams6110 12y agoSounds like what Oracle calls a "correlated subquery" is it the same thing?
- pjungwir 12y agoNo, Postgres has supported those for a long time. For example: SELECT * FROM employees e WHERE EXISTS (SELECT 1 FROM employee_projects ep WHERE ep.employee_id = e.id AND ep.project_id = 5) ; This new feature is a lot like correlated subqueries except you can put that nested SELECT into the FROM clause and still access the employees table.