ibatis中sql语句的计算

sql语句如下
select t.LOOTID,c.COURSEID,c.NAME,t.LOOT_PERSON_NUM, (select count(*) from TB_COURSE_INTERN where COURSEID=c.COURSEID)) as personleave, inner join TB_LOOT_COURSE t on c.COURSEID = t.COURSEID and t.COMPANYID=#companyId# order by beginstr asc

我想要计算 TB_COURSE_INTERN中字段为ere COURSEID等于当前COURSEID的记录有多少条,然后和其他的字段一起返回,这样写的话一直报错未找到要求的 FROM 关键字
求指点,谢谢!!

select count(*) from TB_COURSE_INTERN where COURSEID=c.COURSEID 中的from作用于这个select语句,那么你外面的查询语句, from在哪儿呢,确实没有呀

你好像多了一个小括号,在c.COURSEID)) 这个位置