T-SQL How to get SUM() from a subquery
I need fast answer (I can't check that code right now):
is that query works ? I need to get the total sum of a column values from the subquery, something like that:
select su开发者_StackOverflow中文版m(select time from table) as sometimes group by sometimes
That doesnot work, try this
select sum(time) as sumtime from table
select avg(field_val)
from table1
where field_val in (
SELECT TOP 3 field_val
FROM table1
ORDER BY field_val DESC
)
That isn't a subquery. You only have 1 from...
精彩评论