Examine this query:
SELECT INTERVAL ‘100’ MONTH DURATION FROM DUAL;
What will be the output?
Examine this query:
SELECT INTERVAL ‘100’ MONTH DURATION FROM DUAL;
What will be the output?
The query SELECT INTERVAL '100' MONTH DURATION FROM DUAL; uses the INTERVAL literal to denote a duration of 100 months. In Oracle SQL, when you specify an interval of 100 months, this is equivalent to 8 years and 4 months, because there are 12 months in a year. The output format for intervals in Oracle is '+YY-MM', where YY represents the number of years and MM represents the number of months. Therefore, the output will be '+08-04', indicating an interval of 8 years and 4 months.
Explanation: The given query is using an interval literal with a value of '100' and a unit of 'MONTH'. When using the interval literal syntax, the specified value represents the number of intervals of the given unit. In this case, the query is requesting an interval of 100 months. Since there are 12 months in a year, the interval '100' months is equivalent to 8 years and 4 months. The output format for intervals in Oracle is '+YY-MM', where YY represents the number of years and MM represents the number of months. Therefore, the output will be '+08-04', indicating an interval of 8 years and 4 months. The correct answer is D. +08-04.
it's gets an error when I try it on https://livesql.oracle.com/apex
Don't copy because of bad quote char, write it it's work
D is correct
D is the correct answer
D respuesta revisada y correcta
try SELECT INTERVAL '100' MONTH as DURATION FROM DUAL;
D is the answer
In my test, it returned an error, even though I adjusted the quotes.
I fond my error, the correct is "D"
beware of alias