You cleared my doubt , I was using round function instead of ceil function. round(avg(salary) -avg(replace(salary, 0,''), 0) but I was getting error. Thanks
REPLACE is a string function and the type of the salary column is integer so why do we use the replace function? and here 0 is not a character of a string so how it can be replaced with an empty string?
Thank you ma'am and Merry Christmas!
You cleared my doubt , I was using round function instead of ceil function. round(avg(salary) -avg(replace(salary, 0,''), 0) but I was getting error. Thanks
Haha, same!
REPLACE is a string function and the type of the salary column is integer so why do we use the replace function? and here 0 is not a character of a string so how it can be replaced with an empty string?
THANK U, I WAS STUCK WITH PROBLEM FROM LONG TIME
I need complete SQL course serious
SIMPLE SOLUTION THANKS ...:)
also theory questions of DBMS?
how to do that in ms sql server.. im getting error that Operand data type varchar is invalid for avg operator.
/* This will do the trick for MS SQL server */
select ceiling(avg(salary) - avg(cast(replace(salary, 0,'') as int)))+1 from EMPLOYEES;