| ... | ... | @@ -217,22 +217,18 @@ Ordering can be defined by the "order_by" attribute. |
|
|
|
|["colA", {-asc => "colB"}] | ORDER BY colA, colB ASC|
|
|
|
|
|{ "-asc" => ["colA","colB"] } | ORDER BY colA ASC, colB ASC|
|
|
|
|
|[ "FUNC(colA,?)", "bla" ] | ORDER BY FUNC(colA, ?) /* with "bla bound to ? */|
|
|
|
|
|[ <br>{ "-asc" => "colA" },<br>{ "-desc" => ["colB"] },<br>{ "-asc" => ["colC","colD"] },<br>[ "FUNC(colF, ?)", "bla" ],<br>] |
|
|
|
|
ORDER BY, colA ASC,<br>colB DESC,<br>colC ASC, colD ASC,<br>FUNC(colF, ?) /* with "bla bound to ? */ |
|
|
|
|
|[ <br>{ "-asc" => "colA" },<br>{ "-desc" => ["colB"] },<br>{ "-asc" => ["colC","colD"] },<br>[ "FUNC(colF, ?)", "bla" ],<br>] | ORDER BY, colA ASC,<br>colB DESC,<br>colC ASC, colD ASC,<br>FUNC(colF, ?) /* with "bla" bound to ? */ |
|
|
|
|
|
|
|
|
|
|
|
|
The API also supports [similarity](/API/Queries/Query-Search-Options#similarity) for sorting.
|
|
|
|
|
|
|
|
Any column from a joined/prefetched table or a column selected with ["select"](#select-as) can be used.
|
|
|
|
|
|
|
|
More details can be found here:
|
|
|
|
|
|
|
|
<https://metacpan.org/pod/distribution/DBIx-Class/lib/DBIx/Class/ResultSet.pm#order_by> and
|
|
|
|
<https://metacpan.org/pod/release/ILMARI/SQL-Abstract-1.84/lib/SQL/Abstract.pm#ORDER_BY_CLAUSES>
|
|
|
|
More details can be found here: <https://metacpan.org/pod/SQL::Abstract::Classic#ORDER-BY-CLAUSES>
|
|
|
|
|
|
|
|
## Restrictions
|
|
|
|
|
|
|
|
Keys and values may not contain spaces.
|
|
|
|
Keys may only be "-desc" or "-asc", values may either be a column reference or a permitted function call.
|
|
|
|
|
|
|
|
## Examples
|
|
|
|
|
| ... | ... | |