mysql计算工作日_MySQL
来源:懂视网
责编:小采
时间:2020-11-09 18:43:23
mysql计算工作日_MySQL
mysql计算工作日_MySQL:bitsCN.com mysql计算工作日 Sql代码 DELIMITER $$ drop procedure if exists `pGetWorkDays`$$ create procedure pGetWorkDays(s datetime,e datetime) begin select floor(days/7)*5+days%7 -cas
导读mysql计算工作日_MySQL:bitsCN.com mysql计算工作日 Sql代码 DELIMITER $$ drop procedure if exists `pGetWorkDays`$$ create procedure pGetWorkDays(s datetime,e datetime) begin select floor(days/7)*5+days%7 -cas

bitsCN.com
mysql计算工作日
Sql代码 DELIMITER $$ drop procedure if exists `pGetWorkDays`$$ create procedure pGetWorkDays(s datetime,e datetime) begin select floor(days/7)*5+days%7 -case when 6 between wd and wd+days%7-1 then 1 else 0 end -case when 7 between wd and wd+days%7-1 then 1 else 0 end from (select datediff(e,s)+1 as days,weekday(s)+1 as wd) as a; end$$ DELIMITER ; call pGetWorkDays('2005-01-01','2005-12-31');
bitsCN.com
mysql计算工作日_MySQL
mysql计算工作日_MySQL:bitsCN.com mysql计算工作日 Sql代码 DELIMITER $$ drop procedure if exists `pGetWorkDays`$$ create procedure pGetWorkDays(s datetime,e datetime) begin select floor(days/7)*5+days%7 -cas