The Blunder

  • + 0 comments
    WITH sem_zeros AS (
        SELECT
            Salary,
            CAST(REPLACE(CAST(Salary AS CHAR), "0", "") AS SIGNED) AS salario_limpo 
        FROM
            EMPLOYEES
    )
    
    SELECT
        ROUND(AVG(Salary) - AVG(salario_limpo)) + 1 AS dif_erro
    FROM
        sem_zeros