表结构:
id name createtime
1 张三 1478572263814
2 李四 1478572694843
3 王五 1478573216136
4 赵六 1478574227256
统计当前月份新增记录的数量,sql语句该怎么写呢
表结构:
id name createtime
1 张三 1478572263814
2 李四 1478572694843
3 王五 1478573216136
4 赵六 1478574227256
统计当前月份新增记录的数量,sql语句该怎么写呢
select id, name from table where date_format(FROM_UNIXTIME(createtime) ,'%Y-%m')=date_format(now(),'%Y-%m')