AndOp 函数返回两个日历的交集。
AndOp (cal1 Calendar, cal2 Calendar) returns Calendar;
此函数返回每个时间间隔都处于启用状态且在两个日历中都已启用的日历;其余时间间隔处于禁用状态。生成的日历采用两个开始日期中较晚的一个以及两个模式开始日期中较晚的一个。
如果两个日历的时间间隔单位大小不同,那么生成的日历将具有两个时间间隔单位中较小的一个。
作为两个其他日历使用 AND 运算符组合的结果的日历。
select c_calendar from CalendarTable where c_name = 'hourcal'; c_calendar startdate(2011-01-01 00:00:00), pattstart(2011- 01-02 00:00:00), pattern({32 off,9 on,15 off,9 on,15 off,9 on,15 off,9 on,15 off, 9 on,31 off},hour) select c_calendar from CalendarTable where c_name = 'daycal'; c_calendar startdate(2011-04-01 00:00:00), pattstart(2011- 04-03 00:00:00), pattern({1 off,5 on,1 off},day) select AndOp(c1.c_calendar, c2.c_calendar) from CalendarTable c1, CalendarTable c2 where c1.c_name = 'daycal' and c2.c_name = 'hourcal';
startdate(2011-04-01 00:00:00), pattstart(2011-04-03 00:00:00), pattern({32 off,9 on,15 off,9 on,15 off,9 on,15 off,9 on,15 off, 9 on ,31 off},hour)