【发布时间】:2017-04-23 10:21:09
【问题描述】:
我想计算有多少学生具有 status 'v',其中 table 提交 的提交类型为 '1' 并按 student_id 分组> 所以最后我可以得到这样的表
我试过这样的sql查询
select p.id, (SELECT count(*) FROM (select b.id from student as a , submission as b WHERE a.id = b.student_id and b.id_submission_type =1 and a.status_n='v' and a.id_academic_programe = p.id GROUP BY b.student_id) ) from academic_programe as p
但是给我错误
1054 - “where 子句”中的未知列“p.id”
有什么建议吗?对不起我的英语
【问题讨论】: