I am trying to calculate a field and I want it to behave differently depending on if one of the columns happens to be null. I am using MySQL
CASE
WHEN reply.replies <> NULL THEN
24/((UNIX_TIMESTAMP(NOW())-UNIX_TIMESTAMP(qcr.LAST_MOD_TIME)+3600)/3600)*(ces.EXPERT_SCORE+2.5*scs.SIMILARITY)*(EXP(-reply.replies))
ELSE 1
END as ANSWER_SCORE
Is this the right syntax?
=
,<
and<>
. The result of the comparison isNULL
. Agree that three-valued boolean logic is not for everybody, but you can't say 'it cannot be compared'. – Alienage