请帮忙看下有什么错误

来源:百度知道 编辑:UC知道 时间:2024/05/28 05:40:32
select sum(shl) from
(select top 20 spid,sum(shl) as shl, sum(sshje) as sshje, sum(ml) as ml
from aaa where rq>='2008-01-01' and rq<='2008-01-31' group by spid order by shl desc)

总是提示说: ')' 附近有语法错误。
就是排序的前20个啊

from 后面是接表
你的select嵌套要写在where后面
这样写语法不对

select top 20 spid 是什么意思?不能有空格

整条语句都不知道是啥意思!
这条语句实现什么功能啊?