MySQL (Flow Control statements)

Source: Internet
Author: User

Overview ...

1.Case Syntax

2.If Syntax

3.Iterate Syntax

4.Leave Syntax

5.Loop Syntax

6.Repeat Syntax

7.Return Syntax

8.While Syntax

MySQL supports the,,,, IF CASE ITERATE LEAVE LOOP WHILE , and REPEAT constructs for flow control within stored programs. It also supports RETURN within stored functions.

MySQL does not a support FOR loops.

(1) Case Syntax

case_value    when_valuestatement_list    when_valuestatement_list] ...     statement_list  ]end case

Case] ...     search_condition  statement_list      search_condition  statement_list      statement_list  ]end case

The CASE statement for stored programs implements a complex conditional construct.
Note

There is also a CASE expression, which differs from the statement descr CASE ibed here. See section 12.4, "Control Flow Functions". The statement cannot has an ELSE NULL clause, and it's terminated with END CASE instead of END . CASE

MySQL (Flow Control statements)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.