Produce an OVER clause against this function. Used against aggregate or so-called "window" functions, for database backends that support window functions. The expression:: func.row_number().over(order_by="x") is shorthand for:: from sqlalc
(
self,
*,
partition_by: Optional[_ByArgument] = None,
order_by: Optional[_ByArgument] = None,
rows: Optional[Tuple[Optional[int], Optional[int]]] = None,
range_: Optional[Tuple[Optional[int], Optional[int]]] = None,
groups: Optional[Tuple[Optional[int], Optional[int]]] = None,
)
| 445 | return cast(ClauseList, self.clause_expr.element) |
| 446 | |
| 447 | def over( |
| 448 | self, |
| 449 | *, |
| 450 | partition_by: Optional[_ByArgument] = None, |
| 451 | order_by: Optional[_ByArgument] = None, |
| 452 | rows: Optional[Tuple[Optional[int], Optional[int]]] = None, |
| 453 | range_: Optional[Tuple[Optional[int], Optional[int]]] = None, |
| 454 | groups: Optional[Tuple[Optional[int], Optional[int]]] = None, |
| 455 | ) -> Over[_T]: |
| 456 | """Produce an OVER clause against this function. |
| 457 | |
| 458 | Used against aggregate or so-called "window" functions, |
| 459 | for database backends that support window functions. |
| 460 | |
| 461 | The expression:: |
| 462 | |
| 463 | func.row_number().over(order_by="x") |
| 464 | |
| 465 | is shorthand for:: |
| 466 | |
| 467 | from sqlalchemy import over |
| 468 | |
| 469 | over(func.row_number(), order_by="x") |
| 470 | |
| 471 | See :func:`_expression.over` for a full description. |
| 472 | |
| 473 | .. seealso:: |
| 474 | |
| 475 | :func:`_expression.over` |
| 476 | |
| 477 | :ref:`tutorial_window_functions` - in the :ref:`unified_tutorial` |
| 478 | |
| 479 | """ |
| 480 | return Over( |
| 481 | self, |
| 482 | partition_by=partition_by, |
| 483 | order_by=order_by, |
| 484 | rows=rows, |
| 485 | range_=range_, |
| 486 | groups=groups, |
| 487 | ) |
| 488 | |
| 489 | def within_group( |
| 490 | self, *order_by: _ColumnExpressionArgument[Any] |