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.
WITH CTE AS (SELECT cast(Salary AS DECIMAL (7,2)) AS actual,CAST(REPLACE(Salary, '0', '') AS DECIMAL (7,2) ) AS Differ FROM EMPLOYEES)
SELECT CEILING(AVG(actual)-AVG(Differ)) FROM CTE;
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
The Blunder
You are viewing a single comment's thread. Return to all comments →
WITH CTE AS (SELECT cast(Salary AS DECIMAL (7,2)) AS actual,CAST(REPLACE(Salary, '0', '') AS DECIMAL (7,2) ) AS Differ FROM EMPLOYEES) SELECT CEILING(AVG(actual)-AVG(Differ)) FROM CTE;