Attempting to order table multiple times

前端 未结 3 1131
抹茶落季
抹茶落季 2021-01-29 14:21

I am trying to group multiple rows and order it by the total values but im struggling to figure out whats going wrong.

Name       Total
=======    =======
ASOS           


        
3条回答
  •  栀梦
    栀梦 (楼主)
    2021-01-29 14:54

    Try this:

    SELECT *
    FROM tablename
    ORDER BY
        Name,
        char_length(CAST(Total As varchar(max))) DESC,
        Total DESC
    

提交回复
热议问题