tencent cloud

피드백

ORDER BY Syntax

마지막 업데이트 시간:2024-01-20 17:25:15
    The ORDER BY syntax is used to sort analysis results by a specified column name.

    Syntax Format

    ORDER BY column name [DESC | ASC]
    Note:
    You can specify multiple column names to sort analysis results in different sorting modes, for example, ORDER BY column name 1[DESC | ASC], column name 2[DESC | ASC].
    If you do not specify the keyword DESC or ASC, the system sorts the analysis results in ascending order.
    If the target column for sorting contains duplicated values, the sorting result may be different each time. If you want the sorting result to remain the same in each sorting, you can specify multiple columns for sorting.
    Parameter descriptions:
    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.

    Syntax Example

    Count the number of requests in different states and sort them in descending order by the number of requests:
    * | SELECT status, count(*) AS pv GROUP BY status ORDER BY pv DESC
    Calculate the average request time for each server and sort them in ascending order:
    * | SELECT remote_addr, avg(request_time) as request_time group by remote_addr order by request_time ASC LIMIT 10
    
    문의하기

    고객의 업무에 전용 서비스를 제공해드립니다.

    기술 지원

    더 많은 도움이 필요하시면, 티켓을 통해 연락 바랍니다. 티켓 서비스는 연중무휴 24시간 제공됩니다.

    연중무휴 24시간 전화 지원