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; 

原文地址:https://www.cnblogs.com/php321/p/3304258.html