SQL语句求解答,急!!
select student.stumajor,sc.stuclass,sc.stunumber,student.stuname,SUM(scgrade) as allcout from sc,student where sc.stunumber=student.stunumber and sc.stuclass='班级' and stumajor='专业'group by sc.stunumber,stuname,sc.stuclass,student.stumajor order by SUM(scgrade) desc
就是想将一个班级的同学的总成绩进行排序
但是我加上 and sc.stuclass='班级' and stumajor='专业' 就显示不出来
------解决方案--------------------
SELECT student.stumajor ,
sc.stuclass ,
sc.stunumber ,
student.stuname ,
SUM(scgrade) AS allcout
FROM sc ,
student
WHERE sc.stunumber = student.stunumber
AND sc.stuclass = '班级'
AND stumajor = '专业'
GROUP BY sc.stunumber ,
stuname ,
sc.stuclass ,
student.stumajor
ORDER BY SUM(scgrade) DESC
解决了就好。
------解决方案--------------------既然已经解决,就来接分了!!
打错字了,自己的帖子都不能编辑,BS一下CSDN。