SQLTeam.com | Weblogs | Forums

How to output only sum of a column


#1

Hello,

I have the query SELECT ItemName, Value FROM Table1 and outputs this.

ItemName  Value
A	  4
B	  6
C	  15

I like to run another query to use the above table and give me the total for Value column (4+6+15 = 25)
The new query should generate the following output.

TotalValue
25

Any help would be appreciated.


#2

Try this:

select sum([value]) as TotalValue
  from table1

#3

Thanks bitsmed.