Weather Observation Station 2

  • + 0 comments

    SELECT CAST(ROUND(SUM(LAT_N), 2) AS DECIMAL(10,2)), CAST(ROUND(SUM(LONG_W), 2) AS DECIMAL(10,2)) FROM STATION;

    Successful submission on DB2 server => calculate the sum -> round() which rounds to 2 decimal places but includes trailing zeros as well -> cast it to Decimal(10,2) to remove any trailing zeros after 2 decimal places