You are viewing a single comment's thread. Return to all comments →
SELECT CEIL( AVG(CAST(em.salary AS DECIMAL)) - AVG(CAST(REPLACE(CAST(em.salary AS CHAR), '0', '') AS DECIMAL)) ) AS difference FROM employees em;
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 →
SELECT CEIL( AVG(CAST(em.salary AS DECIMAL)) - AVG(CAST(REPLACE(CAST(em.salary AS CHAR), '0', '') AS DECIMAL)) ) AS difference FROM employees em;