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 关键字
求指点,谢谢!!
ibatis中sql语句的计算
- 写回答
- 好问题 0 提建议
- 关注问题
- 邀请回答
-
2条回答 默认 最新
一只小T 2017-10-16 03:16关注select count(*) from TB_COURSE_INTERN where COURSEID=c.COURSEID 中的from作用于这个select语句,那么你外面的查询语句, from在哪儿呢,确实没有呀
本回答被题主选为最佳回答 , 对您是否有帮助呢?解决 无用评论 打赏 举报