Skip to content

Commit bc4184e

Browse files
authored
Merge pull request github#6051 from github/shati-patel/rank
Clarify docs about rank aggregate
2 parents e3a6daa + b5420a6 commit bc4184e

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

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

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,10 @@ The following aggregates are available in QL:
308308
309309
rank[4](int i | i = [5 .. 15] | i)
310310
311-
Note that the rank indices start at ``1``, so ``rank[0](...)`` returns no results.
311+
.. pull-quote:: Note
312+
313+
- Rank indices start at ``1``, so ``rank[0](...)`` has no result.
314+
- ``rank[1](...)`` is the same as ``min(...)``.
312315

313316
.. index:: strictconcat, strictcount, strictsum
314317

@@ -530,14 +533,21 @@ The query produces these results:
530533

531534
+-----------+---------+------+
532535
| variant | person | cost |
533-
+-----------+---------+------+
536+
+===========+=========+======+
534537
| default | Alice | 201 |
538+
+-----------+---------+------+
535539
| default | Bob | 100 |
540+
+-----------+---------+------+
536541
| default | Charles | 100 |
542+
+-----------+---------+------+
537543
| default | Diane | 0 |
544+
+-----------+---------+------+
538545
| monotonic | Alice | 101 |
546+
+-----------+---------+------+
539547
| monotonic | Alice | 200 |
548+
+-----------+---------+------+
540549
| monotonic | Bob | 100 |
550+
+-----------+---------+------+
541551
| monotonic | Diane | 0 |
542552
+-----------+---------+------+
543553

0 commit comments

Comments
 (0)