SELECT A.wx_name, A.wx_litpic, B . * FROM ( SELECT uid, COUNT( * ) AS daticishu FROM statements WHERE TYPE IN ( 5, 7 ) AND flag = '1' GROUP BY uid ORDER BY COUNT( * ) DESC LIMIT 20 ) AS B JOIN user AS A ON uid = openid LIMIT 0 , 20
SELECT A.wx_name, A.wx_litpic, B . * FROM ( SELECT uid, COUNT( * ) AS daticishu FROM statements WHERE TYPE IN ( 5, 7 ) AND flag = '1' GROUP BY uid ORDER BY COUNT( * ) DESC LIMIT 20 ) AS B JOIN user AS A ON uid = openid LIMIT 0 , 20