Skip to content

Commit 8fdfe54

Browse files
authored
Clarify min, max and rank documentation regarding expression type
1 parent d094bbc commit 8fdfe54

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

docs/codeql/ql-language-reference/expressions.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ The following aggregates are available in QL:
227227

228228
- ``min`` and ``max``: These aggregates determine the smallest (``min``) or largest (``max``)
229229
value of ``<expression>`` among the possible assignments to the aggregation variables.
230-
In this case, ``<expression>`` must be of numeric type or of type ``string``.
230+
``<expression>`` must be of numeric type or of type ``string``, or an explicit order must be defined with ``order by``.
231231

232232
For example, the following aggregation returns the name of the ``.js`` file (or files) with the
233233
largest number of lines, using the number of lines of code to break ties:
@@ -297,8 +297,8 @@ The following aggregates are available in QL:
297297
.. index:: rank
298298

299299
- ``rank``: This aggregate takes the possible values of ``<expression>`` and ranks them.
300-
In this case, ``<expression>`` must be of numeric type or of type ``string``. The aggregation
301-
returns the value that is ranked in the position specified by the **rank expression**.
300+
``<expression>`` must be of numeric type or of type ``string``, or an explicit order must be defined with ``order by``.
301+
The aggregation returns the value that is ranked in the position specified by the **rank expression**.
302302
You must include this rank expression in brackets after the keyword ``rank``.
303303

304304
For example, the following aggregation returns the value that is ranked 4th out of all the

0 commit comments

Comments
 (0)