mysql計(jì)算工作日_MySQL
來(lái)源:懂視網(wǎng)
責(zé)編:小采
時(shí)間:2020-11-09 18:43:23
mysql計(jì)算工作日_MySQL
mysql計(jì)算工作日_MySQL:bitsCN.com mysql計(jì)算工作日 Sql代碼 DELIMITER $$ drop procedure if exists `pGetWorkDays`$$ create procedure pGetWorkDays(s datetime,e datetime) begin select floor(days/7)*5+days%7 -cas
導(dǎo)讀mysql計(jì)算工作日_MySQL:bitsCN.com mysql計(jì)算工作日 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計(jì)算工作日
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
聲明:本網(wǎng)頁(yè)內(nèi)容旨在傳播知識(shí),若有侵權(quán)等問(wèn)題請(qǐng)及時(shí)與本網(wǎng)聯(lián)系,我們將在第一時(shí)間刪除處理。TEL:177 7030 7066 E-MAIL:11247931@qq.com
mysql計(jì)算工作日_MySQL
mysql計(jì)算工作日_MySQL:bitsCN.com mysql計(jì)算工作日 Sql代碼 DELIMITER $$ drop procedure if exists `pGetWorkDays`$$ create procedure pGetWorkDays(s datetime,e datetime) begin select floor(days/7)*5+days%7 -cas