Pergunta de entrevista da empresa Cognitive Capital

In SQL, is there a difference between "sum(colA)+sum(colB)" and "sum(colA+colB)"? If so, what is it?

Resposta da entrevista

Sigiloso

1 de mar. de 2016

The answer expected by the interviewer was that sum(colA+colB) wouldn't work if either column contained a null value, whereas sum(colA)+sum(colB) would continue to work. On a personal note, such silliness arises only when someone is incompetent enough to not use NaN to represent missing values.