MS-SQL sort output in descending order

前端 未结 3 2055
情话喂你
情话喂你 2021-01-15 09:09

I have this MS-SQL query with thousands of row records in database:

SELECT DISTINCT TOP 7 DATENAME(MM, mydatetime) + \' \' + CAST(DAY(mydatetime) AS VA         


        
3条回答
  •  挽巷
    挽巷 (楼主)
    2021-01-15 09:19

    You need to remove the DESC from your ORDER BY clause. Your result is in exact reverse order because of DESC!

提交回复
热议问题