暂无图片
暂无图片
暂无图片
暂无图片
暂无图片

OCP-071-8

说来听一听 2020-03-14
314

题目:

参考答案:A

B:错,NEXT_DAY(DATE,CHAR)

C:错,6显示的是下一个周五

D:错,少一个左括号


参考内容:

1.ADD_MONTHS

Syntax

Description of the illustration ''add_months.gif''


Purpose

ADD_MONTHS returns the date date plus integer months. A month is defined by the session parameter NLS_CALENDAR. The date argument can be a datetime value or any value that can be implicitly converted to DATE. The integer argument can be an integer or any value that can be implicitly converted to an integer. The return type is always DATE, regardless of the data type of date. If date is the last day of the month or if the resulting month has fewer days than the day component of date, then the result is the last day of the resulting month. Otherwise, the result has the same day component as date.

ADD_MONTHS返回输入日期+整数的日期。月份是会话参数NLS_CALENDAR定义的。日期参数可以是日期值或任何能隐式转换成日期的值。整数参数可以是整数或者任何能隐式转换成整数的值。不管输入日期的数据类型是什么,返回类型总是日期。如果输入日期是当月的最后一天或者返回月份的日期比输入日期少,那么就返回月的最后一天。否则,结果就同样的天。


Examples

在这个例子中可以看出,2月29号下个月日期是3月31,2月28号的下个月日期是3月28,1月30号的下个月是2月29。



2.NEXT_DAY

Syntax

Description of the illustration ''next_day.gif''


Purpose

NEXT_DAY returns the date of the first weekday named by char that is later than the date date. The return type is always DATE, regardless of the data type of date. The argument char must be a day of the week in the date language of your session, either the full name or the abbreviation. The minimum number of letters required is the number of letters in the abbreviated version. Any characters immediately following the valid abbreviation are ignored. The return value has the same hours, minutes, and seconds component as the argument date.

NEXT_DAY返回的日期是比输入参数Date往后的一个周里的char天的日期。不管输入日期类型是什么,返回类型总是日期。参数CHAR必须是一周里的一天符合你的会话中的日期语言,要么是全名,要么是缩写。最小字母数要求缩写版本。任何紧跟着有效缩写的字符都被忽略。返回的值和输入值有相同的小时,分钟,和秒。


Examples

例子中可以看出,返回的是接下来一周的第几天,这个第几天则是按照自然周的第几天去返回的,因此我们看到3月11号是周三,查看下一个第三天返回的是17号。


文章转载自说来听一听,如果涉嫌侵权,请发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

评论