筛选用户的购买信息,t1 联结 条件: 零食类,where 近90天: >=date_sub(今天,interval 89 day) 对t1中的用户进行打标,有复购记为1,无复购记为0,生成t2 分组:group by uid, product_id if(count(uid)>1,1,0) as tag 根据t2计算复购率: 分组:group by product_id 复购率:round(sum(tag)/count(tag),3) 排序:order by 取前3:limit select product_id, round(sum(tag)/count(t...