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
|
1978 Discussions
|
Please Login in order to post a comment
mysqlv ->
select ceil(avg(salary) - avg(cast(replace(salary, 0, '') as decimal))) from employees
MYSQL :-
select CEIL(AVG(salary) - AVG(CAST(REPLACE(salary ,'0', '') AS UNSIGNED))) from employees ;
I submitted correct answer to MS SQL, but the answer to MS SQL was not accepted. After I wasted about a half hour, submitted the same code (the final output was 2253, exactly same) to My SQL as a test, it was immediately solved. Many other problem have simillar errors.
select round(avg(salary) - avg(cast(replace(salary,0,'') as integer)))+1 from employees;