Attempting to order table multiple times

前端 未结 3 1126
抹茶落季
抹茶落季 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条回答
  •  梦毁少年i
    2021-01-29 14:48

    Try this

    select * from tablename order by total desc
    

    Selecting two things to ORDER BY doesn't work too well if you're not familiar with ORDER BY syntax. from your description, it looks like you just want the highest total at the top. This query will order the results by total descending (highest first)

    if you want the names to be ascending (lowest first) at the same time, try

    select * from tablename order by name asc, total desc
    

提交回复
热议问题