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.
This same solution (which is what I also came up with) fails on MSSQL Server and DB2 but works on Oracle and MySQL. The trick is to ensure you cast the type of the output to only output 4 decimals (and not pad with zeros on the end, which is what MSSQL and DB2). You can write the above solution to work on all 4 platforms by casting to e.g. decimal(16,4) after rounding.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Weather Observation Station 15
You are viewing a single comment's thread. Return to all comments →
This same solution (which is what I also came up with) fails on MSSQL Server and DB2 but works on Oracle and MySQL. The trick is to ensure you cast the type of the output to only output 4 decimals (and not pad with zeros on the end, which is what MSSQL and DB2). You can write the above solution to work on all 4 platforms by casting to e.g. decimal(16,4) after rounding.