MySQL多个条件判断示例

IT科技类资讯2025-11-03 23:54:151156
MySQL多个条件判断示例
复制use industry_finance;    DELIMITER //    drop procedure if exists updateCursor //    CREATE PROCEDURE updateCursor()    BEGIN    declare id varchar(20);    declare month varchar(20);    declare season varchar(20);    declare cur1 CURSOR FOR SELECT ID_,多断示month_ FROM t_industry_finance_instance;    OPEN cur1;    FETCH cur1 INTO id,month;    WHILE (id is not null ) DO    if(month=01||month=02||month=03) THEN set season=1;    end if;    if(month=04||month=05||month=06) THEN set season=2;    end if;    if(month=07||month=08||month=09) THEN set season=3;    end if;    if(month=10||month=11||month=12) THEN set season=4;    end if;    update t_industry_finance_instance set seasonseason_=season where ID_=id;    FETCH cur1 INTO id,month;    END WHILE;    CLOSE cur1;    END;//    DELIMITER ;    call updateCursor();   1.2.3.4.5.6.7.8.9.10.11.12.13.14.15.16.17.18.19.20.21.22.23.24.25.26.27.
本文地址:http://www.bzuk.cn/html/070d7799852.html
版权声明

本文仅代表作者观点,不代表本站立场。
本文系作者授权发表,未经许可,不得转载。

全站热门

揭秘各大品牌路由器默认用户名密码的安全问题(隐私保护在默认配置中的薄弱环节)

小米4X低配版的性能和体验如何?(低配版4X是否能够满足用户需求?)

华为概念手机(华为概念手机)

选择适合学生使用的苹果电脑(为学生提供高效学习工具的苹果电脑推荐及使用指南)

康佳彩电LED55R6610U质量怎么样?(全面评估LED55R6610U的性能和用户反馈)

EA550GPro(全新款电源,稳定高效,为你带来无限可能)

苹果A1524手机全面评测(探索苹果A1524手机的性能、功能与设计)

亿林云光纤(突破网络连接瓶颈,实现高效数据传输)

友情链接

滇ICP备2023006006号-33