cancel
Showing results for 
Search instead for 
Did you mean: 

How do I make a LATERAL join work like an OUTER join?

Breck_Carter
Participant
0 Kudos
1,279

The FROM clause

SELECT table1.whatever,
       table2.etcetera
  FROM table1, LATERAL ( table-expression ) AS table2 

works as if it was coded as an INNER JOIN with special LATERAL properties... rows in table1 that don't match rows in table2 are excluded from the result set.

LATERAL is very cool (and fast), but so is LEFT OUTER JOIN.

Accepted Solutions (0)

Answers (1)

Answers (1)

VolkerBarth
Contributor
0 Kudos

I'd use OUTER APPLY here, and CROSS APPLY for inner joins, see here... - and particularly Glenn's older blog article - those were the days...