The Blunder

  • + 8 comments

    This is my working code in MS SQL Server:

    SELECT CAST(CEILING((AVG(CAST(Salary AS Float)) - AVG(CAST(REPLACE(Salary, 0, '')AS Float)))) AS INT)
    FROM EMPLOYEES;
    

    The Cast Funtion is to adapt the results to the Data Type expected in the Result Set.