What does the SQL standard LATERAL join (or CROSS APPLY in SQL Server) enable?

SQL Fundamentals Hard

SQL Fundamentals — Hard

What does the SQL standard LATERAL join (or CROSS APPLY in SQL Server) enable?

Key points

  • LATERAL join/CROSS APPLY enables row-by-row parameterized subqueries
  • It allows referencing columns from tables earlier in the same FROM clause
  • Useful for scenarios where subqueries need to be executed for each row
  • Not the same as a full outer join, recursive traversal, or pivot operation

Ready to go further?

Related questions