Introduction
LATERAL join lets you run a subquery for each row of a table, using values from that row. It helps when you want to get related data that depends on each row.
You want to find the top 3 recent orders for each customer.
You need to get the highest scoring review for each product.
You want to list employees along with their latest project details.
You want to join a table with a function that uses columns from that table.