SQL实现工作日计算(3)
WHILE TIMESTAMPDIFF(DAY,next_day,end_day)>=1.0 DO
IF ((DAYOFWEEK(next_day)=7) OR (DAYOFWEEK(next_day)=1)) THEN
SET next_day=next_day+INTERVAL 1 DAY;
ELSE
SET next_day=next_day+INTERVAL 1 DAY;
SET minutes=minutes+480.0;
END IF;
END WHILE;
SET minutes=minutes+TIMESTAMPDIFF(MINUTE,next_day,end_day);
IF ((DAYOFWEEK(start_day)=7) OR (DAYOFWEEK(start_day)=1)) THEN
相关新闻>>
- 发表评论
-
- 最新评论 更多>>