How to get the sum of an entire column in SQLSERVER

1

I need to get the total value of the VOL field (image below), it is already generated by the SUM function. It can be in another query. All periodic tithe is required.

ex: total = VOL (7.6890028) - > sum of the 4 lines of column VOL

    
asked by anonymous 03.05.2018 / 21:56

2 answers

4

Something like:

Select campo1,
       sum(valor1) valor
from tabela
group by cube (campo1)
    
03.05.2018 / 22:12
1

You can do something like this

Select sum(a.VOL) from ( 
    *SUA QUERY AQUI*) a
    
03.05.2018 / 22:06