MYSQL流程控制

一:条件控制语句

            (1):if条件语句:           

 if search_condition then statement_list

                        [elseif search_condition then statement_list].....

                        [else search_condition]

              endif

             (2):case条件语句          

 case case_value

                        when when_value then statement_list

                        [when when_value then statement_list]...

                        [else statement_list]

                end case;

二:  循环控制语句

           (1):loop语句               

 [begin_labe:]loop

                    statement_list

                end loop [end_lable]

            begin_lable 和end_lable参数分别表示循环开始和循环结束的标志。若想提前结束可以用leave loop;

            (2):while语句              

[begin_label:]while search_condition do

                        statement_list

                end while[end_label]

            (3):repeat语句               

[begin_label:]repeat search_codition do

                        statement_list

                end repeat [end_lable]


        

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值