mysql跨表使用count

知识是越用越熟练的,怕以后不常用到时又忘了,记在这里。

SELECT count(p.b_id) as totalNum,lcr.* FROM participator p LEFT JOIN lot_con_record lcr ON p.b_id=lcr.id where lcr.is_result=1 GROUP BY p.b_id; 

posted @ 2013-09-05 20:47  刘水香  阅读(226)  评论(0编辑  收藏  举报