set @cixu:=0;set @lastpage:="";selectpagename,avg(rank) as avg_rnfrom(selectuid,pagename,case when @lastpage != pagrname and @id =uid then @cixu := @cixu 1 when  @lastpage = pagename and @id =uid then @cixu:=@cixuelse @cixu:=0 end as rank,@lastpage := pagename(select distinct uid,pagenamefrom tsorder by uid,date )a)bgroup by pagename;
点赞 8

相关推荐

牛客网
牛客企业服务