case語句。
case語句比起if要復(fù)雜了一些,它可以構(gòu)造更復(fù)雜的條件。
Case condtion
????????? WHEN whenvalue THEN statlist
??????? [when value then statmentlist]
???????? [else statmentlist]
end case
or:
case
????? when scontion then stlist
??? [when sconteiont then statlist]
?? [else statlst]
end case
在編程中if的大多語句可以用case 來完成,當(dāng)然了case的所有作法if都能完成,下面我們來看一個(gè)case的實(shí)例教程吧。
case
????? when iid=2 then
?????????? set @x=@x1+dcount;
??????? else
?????????? set @x2 = @x2+ dcount;
?? end case;
或者
case id
?? when 2 then
? @x1 = @x1 + 5;
else
? @x111cn.net = @x111cn.net+ ‘www.111cn.net’;
end case;
?以上就是mysql 存儲(chǔ)過程case語句語法與實(shí)例教程的內(nèi)容,更多相關(guān)內(nèi)容請(qǐng)關(guān)注PHP中文網(wǎng)(www.php.cn)!
? 版權(quán)聲明
文章版權(quán)歸作者所有,未經(jīng)允許請(qǐng)勿轉(zhuǎn)載。
THE END