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
|
1878 Discussions
|
Please Login in order to post a comment
SELECT CEIL(ABS( (SELECT AVG(salary) FROM EMPLOYEES) - (SELECT AVG(CAST(REPLACE(CAST(salary AS CHAR), '0', '') AS UNSIGNED)) FROM EMPLOYEES) )) AS error_difference;
-- For MySQL
SELECT CAST(CEILING(AVG(CAST(SALARY AS FLOAT)) - AVG(CAST(REPLACE(SALARY, '0', '') AS FLOAT))) AS INT) FROM EMPLOYEES;
select round(avg(Salary))-round(avg(replace(Salary,'0',''))) from EMPLOYEES;
SELECT CEIL(AVG(SALARY)-AVG(REPLACE(SALARY,0,''))) AS DIFFERENCE FROM EMPLOYEES;
Select ROUND(AVG(SALARY))-ROUND(AVG(REPLACE(SALARY,'0',''))) FROM EMPLOYEES