select uid,month,sum((case when nums%7>=3 then 2 else 0 end)+floor(nums/7)*8+nums)as coin from (select uid,date_format(d,'%Y%m')as month,count(ct)as nums from (select d,uid,num,(d-num)as ct from (select distinct date(in_time)as d,uid, row_number()over(partition by uid order by i...