连续查询2个表的时候,可以用sql语句进行比较。。。比如可以查询一个表里面第一天多少玩家登陆,第二天这些玩家再次登陆有多少个,到第三天、第四天。。。。
select count(a.user_id) from
(
select distinct uid from log_login where logtime>=unix_timestamp('2014-1-1 00:00:00') and logtime<unix_timestamp('2014-1-2 00:00:00')
) a
left join
(
select distinct uid from log_login where logtime>=unix_timestamp('2014-1-2 00:00:00') and logtime<unix_timestamp('2014-1-3 00:00:00')
) b
on a.uid = b.uid
where b.uid is not null