新聞中心
MySQL多個(gè)條件判斷是怎樣的呢?下面就為您舉例說明MySQL多個(gè)條件判斷,希望對(duì)您學(xué)習(xí)MySQL多個(gè)條件判斷方面能夠有所啟迪。

成都創(chuàng)新互聯(lián)公司是一家集網(wǎng)站建設(shè),龍山企業(yè)網(wǎng)站建設(shè),龍山品牌網(wǎng)站建設(shè),網(wǎng)站定制,龍山網(wǎng)站建設(shè)報(bào)價(jià),網(wǎng)絡(luò)營(yíng)銷,網(wǎng)絡(luò)優(yōu)化,龍山網(wǎng)站推廣為一體的創(chuàng)新建站企業(yè),幫助傳統(tǒng)企業(yè)提升企業(yè)形象加強(qiáng)企業(yè)競(jìng)爭(zhēng)力??沙浞譂M足這一群體相比中小企業(yè)更為豐富、高端、多元的互聯(lián)網(wǎng)需求。同時(shí)我們時(shí)刻保持專業(yè)、時(shí)尚、前沿,時(shí)刻以成就客戶成長(zhǎng)自我,堅(jiān)持不斷學(xué)習(xí)、思考、沉淀、凈化自己,讓我們?yōu)楦嗟钠髽I(yè)打造出實(shí)用型網(wǎng)站。
- 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();
【編輯推薦】
MySQL replace函數(shù)替換字符串
MySQL字符串連接函數(shù)用法簡(jiǎn)介
mysql查詢大小寫問題
教您如何實(shí)現(xiàn)MySQL全文查詢
MySQL查詢結(jié)果條數(shù)編號(hào)示例
當(dāng)前題目:MySQL多個(gè)條件判斷示例
新聞來源:http://www.dlmjj.cn/article/dhpcgsg.html


咨詢
建站咨詢
