如何按月选择日期时间列?
TABLE A TITLE MY_DATETIME blah 2011-03-26 05:44:43.213 SELECT * FROM TABLE A WHERE MY_DATETIME = "August"
解决方法
SELECT * FROM TABLE A WHERE DATEPART(month,MY_DATETIME) = 8
或者,不太可靠based on language设置:
... WHERE DATENAME(month,MY_DATETIME) = 'August'