你正在寻找DAYOFYEAR()函数吗? http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html#function_dayofyear