一条当然可以啦,,,把 user_info_m 表也连上就是啦,就是下面的c表 已知bid就在where里就行了select a.username,c.用户名,c.等级,count(*) as cnt from bbs_reply a left outer join bbs_main b on a.bid=b.bid left outer join user_info_m c on a.username=c.username group by a.username order by cnt desc limit 0,10
已知bid就在where里就行了select a.username,c.用户名,c.等级,count(*) as cnt from bbs_reply a left outer join bbs_main b on a.bid=b.bid left outer join user_info_m c on a.username=c.username group by a.username order by cnt desc limit 0,10 where b.bid=......
错了,,应该是 select a.username,c.用户名,c.等级,count(*) as cnt from bbs_reply a left outer join bbs_main b on a.bid=b.bid left outer join user_info_m c on a.username=c.username where b.bid='已知的bid' group by a.username order by cnt desc limit 0,10
估计一条语句不行,可以两条,已知bbs_main的bid,如何搞??
多谢!!!
已知bid就在where里就行了select a.username,c.用户名,c.等级,count(*) as cnt from bbs_reply a left outer join bbs_main b on a.bid=b.bid left outer join user_info_m c on a.username=c.username group by a.username order by cnt desc limit 0,10
select a.username,c.用户名,c.等级,count(*) as cnt from bbs_reply a left outer join bbs_main b on a.bid=b.bid left outer join user_info_m c on a.username=c.username where b.bid='已知的bid'
group by a.username order by cnt desc limit 0,10
left outer 是什么意思啊???