The Blunder

Sort by

recency

|

1978 Discussions

|

  • + 0 comments

    mysqlv ->

    select ceil(avg(salary) - avg(cast(replace(salary, 0, '') as decimal))) from employees

  • + 0 comments

    MYSQL :-

    select CEIL(AVG(salary) - AVG(CAST(REPLACE(salary ,'0', '') AS UNSIGNED))) from employees ;

  • + 0 comments
    SELECT CEIL(
        ABS(
            AVG(Salary) -   -- actual
            AVG(CAST(REPLACE(CAST(Salary AS CHAR), '0' , '') AS DECIMAL))   -- miscalculated
        )
    ) FROM EMPLOYEES;
    
  • + 1 comment

    I submitted correct answer to MS SQL, but the answer to MS SQL was not accepted. After I wasted about a half hour, submitted the same code (the final output was 2253, exactly same) to My SQL as a test, it was immediately solved. Many other problem have simillar errors.

  • + 0 comments

    select round(avg(salary) - avg(cast(replace(salary,0,'') as integer)))+1 from employees;