QuestionQ270

VerifiedUsing Single-Row Functions to Customize Output

Evaluate the SQL statement:

SELECT ROUND(45.953, -1), TRUNC(45.936, 2)  
FROM dual;  

Which values are shown?

Explanation

A negative precision of -1 in ROUND rounds to the nearest tens value, so 45.953 becomes 50. TRUNC with precision 2 discards digits after two decimal places without rounding, so 45.936 becomes 45.93.

Community Discussion

No comments yet. Be the first to start the discussion!