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. |
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... |