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.
- Prepare
- SQL
- Aggregation
- The Blunder
- Discussions
The Blunder
The Blunder
Sort by
recency
|
1905 Discussions
|
Please Login in order to post a comment
select ceil(abs(avg(salary) - avg(replace(salary , '0' , '')))) from employees
You can try :))
below one giveing worng answer
select ceil(avg(salary-TRIM(TRAILING '0' FROM salary))) from employees
SELECT ceil (ABS( (SELECT AVG(SALARY) FROM EMPLOYEES) - (SELECT AVG(CAST(REPLACE(SALARY, '0', '') AS UNSIGNED)) FROM EMPLOYEES) ))
Can anyone tell me where i can see all the key words (like REPLACE, CAST ..) used in the sql, the ones which are not present in tutorials from GFG, W3 etc?