select * from
(SELECT
obj.*,@@rownum := @@rownum + 1 AS natianalRank
FROM
(
SELECT
b.open_id,
b.avatar,
b.nickname,
sum(donation_num) donation_num
FROM
h5.h5_act_movement_donation a
JOIN h5.h5_act_weixin_follower b ON a.act_id = 1
AND a.open_id = b.open_id
GROUP BY
b.avatar,
b.nickname
ORDER BY
donation_num,
b.open_id DESC
) AS obj,
(SELECT @@rownum := 0) r)a
where a.open_id=@openid
添加回复
请先登陆