文章詳情頁
mysql - 請問數(shù)據(jù)庫字段為年月日,傳進(jìn)的參數(shù)為月,怎么查詢那個(gè)月所對應(yīng)的數(shù)據(jù)
瀏覽:98日期:2022-06-13 14:52:29
問題描述
問題解答
回答1:select * from table WHERE date_format(date,’%Y-%m’) = ’2017-3’
如果你需要前面加年份的話,可以使用數(shù)據(jù)庫函數(shù)date_format格式可以參看這篇文章http://blog.csdn.net/kangbrot...
排行榜

熱門標(biāo)簽