怎么求1班总分不在前35名学生的语文和数学总分?
SELECT sum(b.语文) AS 语文总分, sum(b.数学) AS 数学总分
FROM b
WHERE (((b.ID) not In (SELECT top 35 b.ID FROM b where 班级=1 ORDER BY b.总分 DESC;)));
我用这个查询结果不对,请高手指教!
好像问题有点歧义,
SELECT Sum(语文) AS 语文总分, Sum(数学) AS 数学总分
FROM b
WHERE (((b.ID) Not In (SELECT TOP 35 (语文+数学+英语+政治+历史+地理) AS 总分
FROM b
WHERE (((b.班级)=1))
ORDER BY b.总分 DESC)));
是不是这个意思啊?