ASC/ASCENDING or DESC/DESCENDING. If no order is specified, it defaults to ascending.
The result will be sorted by the first variable listed.
For equal values, it will go to the next property in the ORDER BY clause, and so on.
Frequently Asked Questions
What is the default sort order in ORDER BY?
What is the default sort order in ORDER BY?
If no direction is specified, ORDER BY defaults to ascending (ASC) order.
Can I sort by multiple properties?
Can I sort by multiple properties?
Yes. List multiple properties separated by commas. The result is sorted by the first property, then ties are broken by subsequent properties in order.
Does ORDER BY work with expressions and aliases?
Does ORDER BY work with expressions and aliases?
Yes. You can order by any expression or alias that appears in the RETURN or WITH clause, including computed values and aggregations.