mysql查询选择当前月份的所有行? [英] mysql query to select all rows of current month?
本文介绍了mysql查询选择当前月份的所有行?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个名为datedate的日期时间类型的列,并且我必须获取当前月的开始日期和结束日期之间的所有行.这是从1/nov/2014到30/Nov/2014.
I have a columns name startdate which is of datetime type.And i have to fetch all rows between start date and end date of a current month.Which is from 1/nov/2014 to 30/Nov/2014.
推荐答案
select * from your_table
where year(curdate()) = year(startdate)
and month(curdate()) = month(startdate)
这篇关于mysql查询选择当前月份的所有行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文