大家好,我是考100分的小小码 ,祝大家学习进步,加薪顺利呀。今天说一说if函数判断周末_SQL日期语句大全,希望您对编程的造诣更进一步.
小朋友作业操碎心,看代码:
use test;
delimiter $$
create procedure pre12()
BEGIN
declare issunday int;
declare datastrtest varchar(255);
declare i int;
set i=1;
while i<3 do
SELECT datastrinner, days into datastrtest,issunday FROM (SELECT datastr as datastrinner ,DAYOFWEEK(datastr) AS days FROM test.test_week where id=i) tmp;
if issunday = 1 then
select datastrtest,issunday,"是" as "是否为周日";
else
select datastrtest,issunday,"不是" as "是否为周日";
end if;
set i=i+1;
end while;
END
$$
call pre12();
代码100分
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 举报,一经查实,本站将立刻删除。
转载请注明出处: https://daima100.com/10936.html