You are viewing a single comment's thread. Return to all comments →
Can someone explian why the the 1st one doesn't work and the 2nd one does:
SELECT CEIL(AVG(Salary)) - AVG(REPLACE(Salary,'0',''))) FROM EMPLOYEES;
SELECT CEIL(AVG(CAST(Salary AS DECIMAL(10,2))) - AVG(REPLACE(Salary,'0',''))) FROM EMPLOYEES;
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 →
Can someone explian why the the 1st one doesn't work and the 2nd one does:
SELECT CEIL(AVG(Salary)) - AVG(REPLACE(Salary,'0',''))) FROM EMPLOYEES;
SELECT CEIL(AVG(CAST(Salary AS DECIMAL(10,2))) - AVG(REPLACE(Salary,'0',''))) FROM EMPLOYEES;