查詢2017的數據:select * from table where year(column)='2017';
查找月份為12的數據:select * from table where month(column)='12';
查找天數為本年第二天的數據:select * from table where dayofyear(column)='2';
year,month,dayofyear是mysql的函數,分別是取得年,月,和當前時間在本年是第幾天的3個函數
查詢當月數據:select * from table where date_format(column,'%Y-%m')=date_format(now(),'%Y-%m')