主机百科
测评与优惠

mysql查询当月数据

mysql查询当月数据:

1
  select * from table where datetime > unix_timestamp(concat(date_format(now(),'%Y-%m-'),'01'));

 

1
  datetime:表中的时间戳字段;  

 

1
  unix_timestamp(concat(date_format(now(),'%Y-%m-'),'01'):当月第一天的开始时间戳。

赞(0)
未经允许不得转载:主机阁 » mysql查询当月数据

登录

找回密码

注册