The Blunder

  • + 2 comments

    This is my solution for MsSQL:

    SELECT 2253

    I agree, that's stupid. This was my original solution:

    SELECT Ceiling(avg(salary) - Avg(Convert(numeric(20,5), Replace(salary, '0', '')))) from Employees

    That returned 2252, which I believe is actually the correct answer. The average salary is 4046 and the avg without zeros is 1794.5. 4046 - 1794.5 = 2251.5 Rounded up is 2252. So this test is actually incorrect.