select a.smalltype_id, count(b.ask_id) as acount, count(c.course_id) as ccount from club_smalltype a left outer join club_ask b on a.smalltype_id=b.smalltype_id left outer join club_course c on a.smalltype_id=c.smalltype_id group by a.smalltype_id; 试试看 :)
a.smalltype_id,
count(b.ask_id) as acount,
count(c.course_id) as ccount
from
club_smalltype a
left outer join
club_ask b
on
a.smalltype_id=b.smalltype_id
left outer join
club_course c
on
a.smalltype_id=c.smalltype_id
group by
a.smalltype_id;
试试看 :)