Multiple choice technology programming languages

SELECT MONTHS_BETWEEN TO_DATE('02-01-1995','MM-DD-YYYY'),TO_DATE('01-01-1995','MM-DD-YYYY') ) FROM DUAL;

  1. -1

  2. 0

  3. 1

  4. 2

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

MONTHS_BETWEEN calculates the difference in months between two dates. Between January 1st and February 2nd, 1995, there is approximately 1 month. The function returns 1 because the dates are in consecutive months.