我在 MySQL 中遇到以下问题
问题出现在别名“T”
select course_id, sec_id, enrollment
from (
select course_id, sec_id, count(ID) as enrollment
from section natural join takes
where semester = 'Fall' and year =2009
group by course_id, sec_id
) as T
where enrollment = (select max(enrollment) from T);
最佳答案
我认为,如果您没有抽牌,您可能会遇到类似以下的情况。
select course_id, sec_id, count(*) as enrollment
from section s
join takes t on s.sec_id = t.course_id
where semester = 'Fall' and year =2009
group by course_id, sec_id
order by count(*) desc
limit 1
;
关于mysql - 错误代码 : 1146. 表 'fe539.t' 不存在,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46511256/