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.
declare @var float
declare @var1 float
set @var = (select avg(cast(salary as float)) from employees)
set @var1 = (select avg(cast(replace (salary, '0', '') as float)) from employees)
select cast(ceiling(@var-@var1) as int)
Contributions and alterations are welcome!
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 →
This is a solution for MS SQL Server
declare @var float declare @var1 float set @var = (select avg(cast(salary as float)) from employees) set @var1 = (select avg(cast(replace (salary, '0', '') as float)) from employees)
select cast(ceiling(@var-@var1) as int)
Contributions and alterations are welcome!