A query like these
SELECT A,B,C,D, (A+B+C+D) as TOTAL
FROM TABLES
If A,B,C and D is NULL. i need to return NULL. But if any one of the them is not NULL. Other will change from NULL to zero. And total(a+b+c+d).
Now try this way
SELECT A,B,.. CASE WHEN (A IS NULL) AND (B IS NULL) AND ... THEN NULL
ELSE ISNULL(A,0) + ISNULL(B,NULL) +... END
But it is so long and I have a lot of total in this whole query. What the best way I can use for this problem?