select actor_id,@curr_cnt:=cnt as cnt , ,@rank) as rank, @prev_cnt:=@curr_cnt as dummy from( select actor_id,count(*) as cnt from film_actor group by actor_id ORDER BY cnt desc ) as der, (,, ) as t -- 实际上相当于赋值操作 -- 排名,考虑并列情况 AS rownum,IF(@total = cnt…