主表 left join (select 从表外键,count(外键) from 从表 group by 外键) 转载于:https://www.cnblogs.com/liushanshan/archive/2010/10/18/1854225.html