mysql 查询某时间段内连续n天登陆人数
//30多万条数据0.4秒 不到,查询某时间段内连续登陆n天的用户,1132条SET @wy=0;SELECT DISTINCT uidFROM (SELECT MAX(date)-MIN(date) less,uid FROM (SELECT date-rn diff, uid, date, rn FROM (SELECT @wy:=@wy+1 rn, u