新聞中心
這里有您想知道的互聯(lián)網(wǎng)營銷解決方案
MySQL多個條件判斷示例
MySQL多個條件判斷是怎樣的呢?下面就為您舉例說明MySQL多個條件判斷,希望對您學習MySQL多個條件判斷方面能夠有所啟迪。

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


咨詢
建站咨詢
