2
これは問題なく動作します。mysql BLOBの問題
SET @postrownum = 0, @postrank = 1, @postprev_val = NULL, @postprev_postnum = NULL;
SELECT @postrownum := @postrownum + 1 AS row,
@postrank := IF(@postprev_val!=postcount,@postrownum,@postrank) AS postrank,
c.user_id,
@postprev_postnum := IF(@postprev_val!=postcount,@postprev_val-postcount,@postprev_postnum) as morepost,
@postprev_val := postcount as postcount,
postcount*5 as postpoint from
(
select user_id,count(user_id) as postcount from post group by user_id order by postcount desc) as c
細かい
SET @postrownum = 0, @postrank = 1, @postprev_val = NULL, @postprev_postnum = NULL;
select id,postrank,morepost,postcount,postpoint from user as a left join
(SELECT @postrownum := @postrownum + 1 AS row,
@postrank := IF(@postprev_val!=postcount,@postrownum,@postrank) AS postrank,
c.user_id,
@postprev_postnum := IF(@postprev_val!=postcount,@postprev_val-postcount,@postprev_postnum) as morepost,
@postprev_val := postcount as postcount,
postcount*5 as postpoint from
(
select user_id,count(user_id) as postcount from post group by user_id order by postcount desc) as c) as b on a.id=b.user_id
morepostは奇妙、[BLOB-1B]に戻ります。このdoesntの仕事。助けてもらえますか?