我需要快速回答(我现在无法检查该代码):
该查询有效吗?我需要从子查询中获取列值的总和,如下所示:
select sum(select time from table) as sometimes group by sometimes
答案 0 :(得分:1)
这不起作用, 试试这个
select sum(time) as sumtime from table
答案 1 :(得分:1)
select avg(field_val)
from table1
where field_val in (
SELECT TOP 3 field_val
FROM table1
ORDER BY field_val DESC
)
答案 2 :(得分:0)
这不是子查询。你只有1来自......