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
|
2088 Discussions
|
Please Login in order to post a comment
ORACLE
SELECT CEIL(AVG(SALARY)-AVG(TO_NUMBER(REPLACE(TO_CHAR(SALARY),'0','')))) FROM EMPLOYEES;
MS SQL
SELECT ceiling(AVG((salary) - CAST(REPLACE(CAST(salary AS VARCHAR), '0', '') AS Numeric))) FROM Employees;
select ceil(avg(salary)- avg(replace(salary,'0',''))) from employees;
SELECT CEILING(AVG(sal.actual - sal.fake)) AS blunder FROM ( SELECT CEILING(SALARY) AS actual, ROUND(CEILING(CAST(REPLACE(SALARY, '0', '') AS UNSIGNED))) AS fake FROM EMPLOYEES ) AS sal;