You are viewing a single comment's thread. Return to all comments →
The conversion to float is what got me to pass:
select cast(ceiling(avg(cast(salary as float)) - avg(convert(float,replace(convert(varchar,salary),'0',''))) ) as int) from employees;
That is just plain ugly.
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 →
The conversion to float is what got me to pass:
select cast(ceiling(avg(cast(salary as float)) - avg(convert(float,replace(convert(varchar,salary),'0',''))) ) as int) from employees;
That is just plain ugly.