签到表: 需求:统计连续签到的 用户 1.根据用户和日期分组 select user_name, sign_date from user_sign group by user_name, sign_date order by user_name, sign_date 2.取出行号 select user_name, sign_date, , ) as num, @tmp := user_name from (select user_name, sign_date from user_sign g…