SQL语法检查

时间:2013-02-20 12:47:47

标签: sql sum between having

我想知道这个SQL查询是否正确:

Select t
from S
having sum(S.r) between 0 AND 10000

我的问题是关于X和Y之间的sum() 这是对的吗?

1 个答案:

答案 0 :(得分:0)

你缺少GROUP BY条款

Select t
from S
GROUP BY t
having sum(S.r) between 0 AND 10000