我需要从MySQL数据库中 Select 当月第一天和当天之间的数据.
select*from table_name
where date between "1st day of current month" and "current day"
有人能提供这个查询的工作示例吗?
我需要从MySQL数据库中 Select 当月第一天和当天之间的数据.
select*from table_name
where date between "1st day of current month" and "current day"
有人能提供这个查询的工作示例吗?
select * from table_name
where (date between DATE_ADD(LAST_DAY(DATE_SUB(CURDATE(), interval 30 day), interval 1 day) AND CURDATE() )
或者更好:
select * from table_name
where (date between DATE_FORMAT(NOW() ,'%Y-%m-01') AND NOW() )