mysql存储过程一直在报;的错

陈炎 发布于 2013/04/25 15:40
阅读 176
收藏 0
BEGINdeclare numareaId int(10); declare currentareaId int(10); SELECT COUNT(areaId),MIN(areaId) INTO @a ,@b FROM option_area_info; SET numareaId= @a ; SET currentareaId=@b; loop1:WHILE numareaId>0 DO SET @AID = currentareaId; insert into statistics_user_report(areaId,everOnlineTime,sumOnlineTime,avgOnlineTime,avgPayCount,hyPlayerCount,lcPlayerCount,createTime) values( currentareaId, (select sum(timestampdiff(minute,lastLoginTime,lastLogoutTime)) from log_logout where lastLoginTime >=current_date() and lastLoginTime=8 in (SELECT playerId FROM (SELECT playerId,WEEK(lastLoginTime) weekNo FROM log_logout where areaId=@AID) t GROUP BY t.playerId,t.weekNo HAVING COUNT(1) >= 3)))/(select count(1) from (SELECT playerId FROM (SELECT playerId,WEEK(current_date()) weekNo FROM log_logout where areaId=@AID) t GROUP BY t.playerId,t.weekNo HAVING COUNT(1) >= 3 in (select playerId from log_logout where (select sum(timestampdiff(hour,lastLoginTime,lastLogoutTime)) from log_logout)>=8 and areaId=@AID))t))), (select ((select count(createTime) from log_input_ggold where createTime>=date_sub(curdate(),interval 7 day) and createTime=date_sub(curdate(),interval 7 day) and lastLoginTime= 3 in (select playerId from log_logout where (select sum(timestampdiff(hour,lastLoginTime,lastLogoutTime)) from log_logout)>=8 and areaId=@AID))t)), (select count(1) from (SELECT playerId FROM (SELECT playerId FROM log_logout where areaId=1 and lastLoginTime>=date_sub(curdate(),interval 7 day) and lastLoginTime= 3 in (select playerId from log_logout where (select sum(timestampdiff(hour,lastLoginTime,lastLogoutTime)) from log_logout)>=8 and areaId=1))t), (select ((select count(1) from (SELECT playerId FROM (SELECT playerId FROM log_logout where areaId=@AID and lastLoginTime>=date_sub(curdate(),interval 14 day) and lastLoginTime= 3 in (select playerId from log_logout where (select sum(timestampdiff(hour,lastLoginTime,lastLogoutTime)) from log_logout)>=8 and areaId=@AID))t) in (select count(1) from (SELECT playerId FROM (SELECT playerId FROM log_logout where areaId=@AID and lastLoginTime>=date_sub(curdate(),interval 7 day) and lastLoginTime= 3 in (select playerId from log_logout where (select sum(timestampdiff(hour,lastLoginTime,lastLogoutTime)) from log_logout)>=8 and areaId=@AID))t))t), NOW()); SET numareaId=numareaId-1; SET currentareaId=currentareaId+1; END WHILE loop1; END
加载中
0
陈炎
我次奥!!!发上来怎么这么乱啊!!
书一
书一
用代码的方式贴上来,
0
灰花走湿
灰花走湿
建议连同错误也说下,这样才能结合错误分析
0
子龙哟哟哟
子龙哟哟哟
我也是啊,明明语法绝对没错的他就要报错
返回顶部
顶部