Ctony_ 2016-11-09 14:58 采纳率: 0%
浏览 1146

mysql统计当前月份的记录数

表结构:

id  name  createtime
1  张三   1478572263814
2  李四   1478572694843
3  王五   1478573216136
4  赵六   1478574227256

统计当前月份新增记录的数量,sql语句该怎么写呢

  • 写回答

1条回答 默认 最新

  • threenewbee 2016-11-09 15:15
    关注
     select id, name from table where date_format(FROM_UNIXTIME(createtime) ,'%Y-%m')=date_format(now(),'%Y-%m')  
    
    评论

报告相同问题?