//// 时间间隔一天的数量 select count(userid) from t_users where ((UNIX_TIMESTAMP(login_time) - UNIX_TIMESTAMP(create_time)) div 86400 )=1
//// 时间间隔一天的数量,实际到秒。 select count(userid) from t_users where ((UNIX_TIMESTAMP(login_time) - UNIX_TIMESTAMP(create_time)) div 86400 )=1
///// 只算天数的差值。 select userid FROM t_users WHERE datediff(date(login_time),date(create_time)) =7 and datediff(date(now()),date(create_time)) =7
///// 只算天数的差值。 select count(userid) FROM t_users WHERE datediff(date(login_time),date(create_time)) =1 and datediff(date(now()),date(create_time)) =1
///// 和昨天进行比较 。 select count(userid) FROM t_users WHERE DATE_SUB(curdate(),INTERVAL 1 DAY) = date(create_time)