The Blunder

  • + 1 comment

    Can someone explian why the the 1st one doesn't work and the 2nd one does:

    1. SELECT CEIL(AVG(Salary)) - AVG(REPLACE(Salary,'0',''))) FROM EMPLOYEES;

    2. SELECT CEIL(AVG(CAST(Salary AS DECIMAL(10,2))) - AVG(REPLACE(Salary,'0',''))) FROM EMPLOYEES;