ORDER BY is used to sort the output results. Currently, you can sort the results only by a single column.

Syntax:

order by column name [desc|asc]

Example:

method :PostLogstoreLogs |select avg(latency) as avg_latency,projectName group by projectName 
HAVING avg(latency) > 5700000
order by avg_latency desc