Return a :class:`_expression.Lateral` object. :class:`_expression.Lateral` is an :class:`_expression.Alias` subclass that represents a subquery with the LATERAL keyword applied to it. The special behavior of a LATERAL subquery is that it appears in the FROM clause of an enclosi
(
selectable: Union[SelectBase, _FromClauseArgument],
name: Optional[str] = None,
)
| 332 | |
| 333 | |
| 334 | def lateral( |
| 335 | selectable: Union[SelectBase, _FromClauseArgument], |
| 336 | name: Optional[str] = None, |
| 337 | ) -> LateralFromClause: |
| 338 | """Return a :class:`_expression.Lateral` object. |
| 339 | |
| 340 | :class:`_expression.Lateral` is an :class:`_expression.Alias` |
| 341 | subclass that represents |
| 342 | a subquery with the LATERAL keyword applied to it. |
| 343 | |
| 344 | The special behavior of a LATERAL subquery is that it appears in the |
| 345 | FROM clause of an enclosing SELECT, but may correlate to other |
| 346 | FROM clauses of that SELECT. It is a special case of subquery |
| 347 | only supported by a small number of backends, currently more recent |
| 348 | PostgreSQL versions. |
| 349 | |
| 350 | .. seealso:: |
| 351 | |
| 352 | :ref:`tutorial_lateral_correlation` - overview of usage. |
| 353 | |
| 354 | """ |
| 355 | return Lateral._factory(selectable, name=name) |
| 356 | |
| 357 | |
| 358 | def outerjoin( |