PL/SQL daily question: negative output

Source: Internet
Author: User

PL/SQL daily question: negative output question: Which options output a negative number? If you are sure that none of the following is correct, select E [SQL] www.2cto.com A DECLARE l_date2 DATE: = date '2017-12-20 '; l_date1 DATE: = l_date2-1; BEGIN Week (MONTHS_BETWEEN (l_date1, l_date2); END;/B DECLARE l_date1 DATE: = date '2017-12-20 '; l_date2 DATE; BEGIN DBMS_OUTPUT.put_line (MONTHS_BETWEEN (l_date1, l_date2); END;/c declare l_date1 DATE: = date '2017-12-20 '; l_date2 DATE: = l_date1; BEGIN DBMS_OUTPUT.put _ Line (MONTHS_BETWEEN (l_date1, l_date2); END;/d declare l_date1 DATE: = date '2017-12-20 '; l_date2 DATE: = l_date1-1; BEGIN DBMS_OUTPUT.put_line (MONTHS_BETWEEN (l_date1, l_date2); END;/knowledge point supplement -- MONTHS_BETWEEN usage instructions Oracle's MONTHS_BETWEEN date function returns the number of months between two dates, is the number of months between the first parameter date and the second parameter date. If the two parameters are equal, 0 is returned. If the first parameter is greater than the second parameter, positive is returned. If the first parameter is smaller than the second parameter, a negative number is returned. Obtain the number of months when getting the absolute value in the integer. Answer: ① A is correct ② B L_DATE2 is not assigned A value, so MONTHS_BETWEEN returns A null value. ③ If the two parameters are the same, return 0. ④ D results are the opposite of A, and return an integer

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.