帮我看看这条select语句
select count(paper_deptid) as papercount,paper_deptid,dept_name
from papers,dept
where papers.paper_deptid=dept.dept_id
group by papers.paper_deptid
提示错误:列 'dept.dept_name' 在选择列表中无效,因为该列既不包含在聚合函数中,也不包含在 GROUP BY 子句中。
SQL
------解决方案--------------------Group by 没有包含 dept_name
------解决方案--------------------select count(paper_deptid) as papercount,paper_deptid,dept_name
from papers,dept
where papers.paper_deptid=dept.dept_id
group by papers.paper_deptid ,papercount,dept_name