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
|
1636 Discussions
|
Please Login in order to post a comment
MYSQL
SELECT CEIL(AVG(salary) - AVG(REPLACE(salary, '0', ''))) AS error_amount FROM EMPLOYEES;
Oracle
SELECT CEIL(AVG(SALARY) - AVG(REPLACE(SALARY, "0", ""))) FROM EMPLOYEES
SELECT CEILING(AVG(salary) - AVG(CAST(REPLACE(CAST(salary AS CHAR), '0', '') AS DECIMAL))) FROM employees;
Oracle Sql: select ceil(avg(salary) - avg(replace(salary,'0',''))) from employees;