@@ -201,9 +201,10 @@ based on the `Unicode value <https://en.wikipedia.org/wiki/List_of_Unicode_chara
201
201
of each character.
202
202
203
203
To specify a different order, follow ``<expression> `` with the keywords ``order by ``, then
204
- the expression that specifies the order, and optionally the keyword ``asc `` or ``desc ``
204
+ one or more comma-separated expressions that specifies the order, and optionally the keyword ``asc `` or ``desc `` after each expression
205
205
(to determine whether to order the expression in ascending or descending order). If you don't
206
- specify an ordering, it defaults to ``asc ``.
206
+ specify an ordering, it defaults to ``asc ``. For example, ``order by o.getName() asc, o.getSize() desc ``
207
+ might be used to order some object by name, breaking ties by descending size.
207
208
208
209
The following aggregates are available in QL:
209
210
@@ -229,11 +230,11 @@ The following aggregates are available in QL:
229
230
In this case, ``<expression> `` must be of numeric type or of type ``string ``.
230
231
231
232
For example, the following aggregation returns the name of the ``.js `` file (or files) with the
232
- largest number of lines:
233
+ largest number of lines, using the number of lines of code to break ties :
233
234
234
235
.. code-block :: ql
235
236
236
- max(File f | f.getExtension() = "js" | f.getBaseName() order by f.getTotalNumberOfLines())
237
+ max(File f | f.getExtension() = "js" | f.getBaseName() order by f.getTotalNumberOfLines(), f.getNumberOfLinesOfCode() )
237
238
238
239
The following aggregation returns the minimum string ``s `` out of the three strings mentioned
239
240
below, that is, the string that comes first in the lexicographic ordering of all the possible
0 commit comments