Examine this query:
SELECT TRUNC(ROUND(156.00,-2),-1) FROM DUAL;
What is the result?
Examine this query:
SELECT TRUNC(ROUND(156.00,-2),-1) FROM DUAL;
What is the result?
The ROUND function with a precision of -2 rounds the number 156.00 to the nearest hundred, resulting in 200. The TRUNC function with a precision of -1 then truncates the number 200 to the nearest ten, which still results in 200. Therefore, the final result of the SQL query is 200.
Answer is B
TRUNCATE here do nothing
can someone explain why the answer is 200?
because ROUND(156.00,-2) = 200 and trunc(200,-1)=200 (-1 => first number before coma 0 is trunced to 0)
B is the correct tested
B is correct, run it in SQL Developer
A is the right one : The ROUND(156.00, -2) function call rounds the number 156.00 to the nearest hundredth, resulting in the value 200. The TRUNC(200, -1) function call truncates the number 200 to the nearest ten, resulting in the value 150. Therefore, the final result of the SQL query is 150.
Just run the query and you'll get the result : 200.
TRUNC does nothing here. The rounding of -2 gives closest order of 100, 156->200. Then 200 is truncated to 200
Answer is 200
Respuesta revisada
I have run it in oracle and the answer is 200.