Difference of two columns with possible NULL cells I need to sort a table by the difference of two columns as

SELECT (first - second) AS dif
    FROM table1
ORDER BY dif DESC


but the two columns can be NULL. In this case, it returns the error:

BIGINT UNSIGNED value is out of range


The solution to this error is to use IFNULL(col,0), but the problem is that I need dif to be NULL if any of the columns is NULL
Many ways of doing this, but I find this readable: 

SELECT CASE WHEN first IS NULL OR second IS NULL THEN NULL
       ELSE first - second END AS dif
    FROM table1
ORDER BY 1 DESC