Merge pull request #8760 from Marcono1234/patch-1

Clarify `min`, `max` and `rank` documentation
This commit is contained in:
Anders Schack-Mulligen
2022-04-25 12:20:00 +02:00
committed by GitHub

View File

@@ -227,8 +227,9 @@ The following aggregates are available in QL:
- ``min`` and ``max``: These aggregates determine the smallest (``min``) or largest (``max``)
value of ``<expression>`` among the possible assignments to the aggregation variables.
In this case, ``<expression>`` must be of numeric type or of type ``string``.
``<expression>`` must be of numeric type or of type ``string``, or an explicit order must be defined with ``order by``.
When using ``order by``, more than one result may exist in case of ties.
For example, the following aggregation returns the name of the ``.js`` file (or files) with the
largest number of lines, using the number of lines of code to break ties:
@@ -297,9 +298,10 @@ The following aggregates are available in QL:
.. index:: rank
- ``rank``: This aggregate takes the possible values of ``<expression>`` and ranks them.
In this case, ``<expression>`` must be of numeric type or of type ``string``. The aggregation
returns the value that is ranked in the position specified by the **rank expression**.
``<expression>`` must be of numeric type or of type ``string``, or an explicit order must be defined with ``order by``.
The aggregation returns the value that is ranked in the position specified by the **rank expression**.
You must include this rank expression in brackets after the keyword ``rank``.
When using ``order by``, more than one result may exist in case of ties.
For example, the following aggregation returns the value that is ranked 4th out of all the
possible values. In this case, ``8`` is the 4th integer in the range from ``5`` through