2012-12-19 54 views
3

我的查詢是SQL排序DATENAME不起作用

USE MyDB 

SELECT DATENAME(DD, s.requestdate) 
FROM sample_table s 
WHERE MONTH(s.requestdate) = 12 
GROUP BY DATENAME(DD, s.requestdate) 
ORDER BY DATENAME(DD, s.requestdate) DESC 

我期望的輸出是由本月一日降序排序,但是我的輸出是有序的,例如

9 
8 
7....till 1 then 19, 18...till 11 

什麼時我錯過了?

回答