mysql 多级关联查询

SELECT fakeid,weiname,headimg,(SELECT COUNT(id) FROM wzyq_weinews WHERE fakeid = wzyq_weiapps.fakeid) as mun FROM wzyq_weiapps ORDER BY (SELECT COUNT(id) FROM
 wzyq_weinews WHERE fakeid = wzyq_weiapps.fakeid) DESC LIMIT 10
 
 SELECT fakeid,weiname,headimg,(SELECT COUNT(id) FROM wzyq_weinews WHERE fakeid = wzyq_weiapps.fakeid) FROM wzyq_weiapps WHERE guanzhudic <> '' LIMIT 17

 

你可能感兴趣的