用户排名查询
SELECT b.* FROM
(
SELECT t.nickname,t.id,t.avatar_url,t.redpacket_price,t.type, @rownum := @rownum + 1 AS rownum
FROM (SELECT @rownum := 0) r,
(SELECT * FROM hjmallind_user
ORDER BY redpacket_price DESC) AS t
) AS b WHERE b.id = 1 AND b.type = 1;