ORDER BY
syntax is used to sort analysis results by a specified column name.ORDER BY column name [DESC | ASC]
ORDER BY column name 1[DESC | ASC], column name 2[DESC | ASC]
.DESC
or ASC
, the system sorts the analysis results in ascending order.Parameter | Description |
Column name | Group data by log field name or aggregate function calculation result column. |
DESC | Sort data in descending order. |
ASC | Sort data in ascending order. |
* | SELECT status, count(*) AS pv GROUP BY status ORDER BY pv DESC
* | SELECT remote_addr, avg(request_time) as request_time group by remote_addr order by request_time ASC LIMIT 10
Was this page helpful?