Testing for a != 'null'
will never be true. you need to use a is not null
.
However, to return a null total if any of the numbers are null, just do this:
select ts, a+b+c
from tablename;
Why does this work? Because in SQL if any part of an expression is null, the whole expression is null. This makes sense when you consider that null means "unknown". Logically, when part of a calculation is unknown, then the result is unknown.