View Single Post
  #2 (permalink)  
Old 03-05-2007, 02:17 AM
Dimitar
 
Posts: n/a
Default SQL 92 answer. Re: can i wrire a query which sum up more than 2 columns in a single table?

Doesn't this work:
[sql]
select sum(col1+col2+col3) from theTable
[/sql]
?
And I can resist posting a variant using unions:
[sql]
select sum(col) from (select sum(c1) as col from t union all select sum(c2) as col from t union all select sum(c3) from t) as theTable
[/sql]

Please, tell us if this helps.
Edit/Delete Message Reply With Quote