//查找近半个月的数据
SELECT COUNT(*) FROM t_user
WHERE DATE_SUB(CURDATE(), INTERVAL 15 DAY) <= DATE(createTime)//MySQL查询数据库近半个月中某一天当中的数据条数
SELECT LEFT(createTime,10) AS TIME,COUNT(*) FROM t_user ,t_user_info
WHERE DATE_SUB(CURDATE(), INTERVAL 15 DAY) <= DATE(createTime) AND channelId = '90000006' AND t_user.`userId` = t_user_info.`userId`
GROUP BY LEFT(createTime,10) ORDER BY TIME