Weather Observation Station 19

  • + 2 comments

    In Oracle, if the last digit after a ROUND is 0, Oracle drops the 0 (thereby giving a wrong answer)! How does one defeat this?

    both of these give me 19.887 instead of 19.8870

    select  cast(sqrt(power((max(lat_n) - max(long_w)),2) + power((min(lat_n) - min(long_w)), 2)) as decimal(10,4)) from station;
    SELECT ROUND(SQRT(POWER((MAX(long_w) - MAX(lat_n)), 2) + POWER((MIN(long_w) - MIN(lat_n)), 2)), 4) FROM station;