sum column in case expressions
<p>I want if the users age>20 ,Columns1 and columns2 sum Gather and show<br>
I wrote the following code but error:<br>
<code>SELECT SUM(CASE WHEN age&gt;20  THEN col1+col2+col3 ELSE 0 END) AS 'result1', 
SUM(CASE WHEN age=20  THEN col1+col2+col3 ELSE 0 END) AS 'result2', 
SUM(CASE WHEN age&lt;20  THEN col1+col2+col3 ELSE 0 END) AS 'result3'
FROM users
</code>
how to solve this??</p>