• And if the 0's can be NULLs in the table instead, you can get rid of all the NULLIF's.