diff options
Diffstat (limited to 'docs/ref')
| -rw-r--r-- | docs/ref/models/expressions.txt | 34 |
1 files changed, 32 insertions, 2 deletions
diff --git a/docs/ref/models/expressions.txt b/docs/ref/models/expressions.txt index 6dfe6c453a..807a946551 100644 --- a/docs/ref/models/expressions.txt +++ b/docs/ref/models/expressions.txt @@ -889,7 +889,7 @@ Frames For a window frame, you can choose either a range-based sequence of rows or an ordinary sequence of rows. -.. class:: ValueRange(start=None, end=None) +.. class:: ValueRange(start=None, end=None, exclusion=None) .. attribute:: frame_type @@ -899,18 +899,48 @@ ordinary sequence of rows. the standard start and end points, such as ``CURRENT ROW`` and ``UNBOUNDED FOLLOWING``. -.. class:: RowRange(start=None, end=None) + .. versionchanged:: 5.1 + + The ``exclusion`` argument was added. + +.. class:: RowRange(start=None, end=None, exclusion=None) .. attribute:: frame_type This attribute is set to ``'ROWS'``. + .. versionchanged:: 5.1 + + The ``exclusion`` argument was added. + Both classes return SQL with the template: .. code-block:: sql %(frame_type)s BETWEEN %(start)s AND %(end)s +.. class:: WindowFrameExclusion + + .. versionadded:: 5.1 + + .. attribute:: CURRENT_ROW + + .. attribute:: GROUP + + .. attribute:: TIES + + .. attribute:: NO_OTHERS + +The ``exclusion`` argument allows excluding rows +(:attr:`~WindowFrameExclusion.CURRENT_ROW`), groups +(:attr:`~WindowFrameExclusion.GROUP`), and ties +(:attr:`~WindowFrameExclusion.TIES`) from the window frames on supported +databases: + +.. code-block:: sql + + %(frame_type)s BETWEEN %(start)s AND %(end)s EXCLUDE %(exclusion)s + Frames narrow the rows that are used for computing the result. They shift from some start point to some specified end point. Frames can be used with and without partitions, but it's often a good idea to specify an ordering of the |
