Count up numbers from a specific column Hi there was wondering if someone could help me out, and can give me a little code example.
i have a table named "projecten", and columns named "pstatus and pafgifte" these columns have numbers only.
I would like to count up all "pafgifte" with "pstatus = 2" only, and echo result.

help would be appreciated.
Like this:

select sum(case when pstatus=2 then pafgifte else 0 end) pafgifte_total
from projecten


Assuming you mean to add the numbers together.