答案 0 :(得分:3)
You can use the CONVERT
function on your [Month]
column (Month + Year). That will convert each value to a DATE
object corresponding to the first day of the month/year. Then do a sort on that:
SELECT
*
FROM
MyTable
ORDER BY
CONVERT(DATE,[Month])
答案 1 :(得分:0)
您可以将colum(" Monnth"" Year")转换为DATE TYPE并按DATE colum排序
SELECT
TO_DATE('August 2017'
,'Month YYYY')
FROM DUAL;
答案 2 :(得分:0)
我会使用日期字段并按此排序。您可以使用:
concate(DATENAME(month,MyDateField), " ", YEAR(MyDateField))
在视图,查询或持久计算列中,具体取决于哪种方式最适合您。