select c.*,
(select count(hcus.id) from hcus where c.id=hcus.id and study_status='finished') as learnStuNum,
(select count(hcus.id) from hcus where c.id=id ) as learnNum
from c
where c.id=#{id}
本文摘自 :https://www.cnblogs.com/
海量資源,盡在掌握
select c.*,
(select count(hcus.id) from hcus where c.id=hcus.id and study_status='finished') as learnStuNum,
(select count(hcus.id) from hcus where c.id=id ) as learnNum
from c
where c.id=#{id}
本文摘自 :https://www.cnblogs.com/