select t1 as businessDate,count(*) as userCount from
(select distinct case when hh < 28800 then date_format(date_add(tt,interval -1 day),'%Y-%m-%d') else date_format(tt,'%Y-%m-%d') end t1,hh,openId,date_format(tt,'%Y-%m-%d %H:%i') tt from (
(select distinct case when hh <28800 then date_format(date_add(tt,interval -1 day),'%Y-%m-%d') else date_format(tt,'%Y-%m-%d') end t1,hh,openId,date_format(tt,'%Y-%m-%d %H:%i') tt from (
select timestampdiff(second,date_format(tt,'%Y-%m-%d 00:00:00'),tt) hh,openId,tt from (
select distinct openId,date_format(from_unixtime(time),'%Y-%m-%d %H:%i') tt,time from fx_member_google where 1=1 and time is not null
select t1 as businessDate,count(*) as userCount from
(select distinct case when hh < 28800 then date_format(date_add(tt,interval -1 day),'%Y-%m-%d') else date_format(tt,'%Y-%m-%d') end t1,hh,username,date_format(tt,'%Y-%m-%d %H:%i') tt from (
select timestampdiff(second,date_format(tt,'%Y-%m-%d 00:00:00'),tt) hh,username,tt from (
select username,min(date_format(from_unixtime(time),'%Y-%m-%d %H:%i')) tt from fx_code where 1=1