We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
- Prepare
- SQL
- Aggregation
- The Blunder
- Discussions
The Blunder
The Blunder
Sort by
recency
|
2074 Discussions
|
Please Login in order to post a comment
The question asks to generate the next integer which is 2253 so we need to use CEIL function in the query to find next integer and not the correct ans that is 2252.
#**select ceil(avg(Salary)- avg(replace(Salary,'0',''))) from EMPLOYEES **
SELECT ceil(avg(Salary) - avg(REPLACE(Salary,'0',''))) FROM Employees;
2252 IS SHOWING WRONG
SELECT ceil(avg(Salary) - avg(REPLACE(Salary,'0',''))) FROM Employees;
select ceil(avg(salary)-avg(replace(salary,"0",""))) from Employees;
SELECT CEIL(AVG(salary) - AVG(CAST(REPLACE(salary, '0', '') AS UNSIGNED))) AS error_amount FROM EMPLOYEES;