mysql query of data

how mysql query one year of data
select * from table where date_format (date, '% Y-% m-% d ') = '2014-04-01' date
select * from table where date_format (date, '% Y-% m ') =' 2014-04 'month
select * from table where date_format (date,'% Y ') =' 2014 ' in

that DATE_FORMAT (date,'% Y-% m-% d ') where the length of the parameter

Published 75 original articles · won praise 9 · views 50000 +

Guess you like

Origin blog.csdn.net/zy1471162851/article/details/102464978