MySQL-流程控制结构

image

image

image

image

image

image

案例

image

CREATE PROCEDURE test_case(IN score INT)  
BEGIN
	CASE
	WHEN score>=90 AND score<=100 THEN SELECT 'A';
	WHEN score>=80 THEN SELECT 'B';
	WHEN score>=60 THEN SELECT 'C';
	ELSE SELECT 'D';
	END CASE;
END $

CALL test_case(95)

image

if 结构

image

案例

image

image

image

循环结构

image

重点是while

image

image

image

案例

image

image

image

案例 添加控制语句leave

image

image

image

案例 添加控制语句iterate

image

image

image

循环结构的总结

image

流程控制经典案例讲解

image

image

image

总结 !!!!!!!!!!!!

image

image

image

image

image

image

image

image

image

image

image

image

image

image

image

image

image

image

image

image

image

posted @ 2022-05-03 11:47  司砚章  阅读(21)  评论(0编辑  收藏  举报