1、错误描述
2、错误原因
BEGIN SELECT stuAge INTO amount; IF stuAge IS NOT NULL THEN SET stuAge = stuAge + 1; SELECT stuAge INTO amount1; ELSE SELECT 20 INTO amount2; END IF; SELECT stuAge INTO amount3; END;
amount实际是stuAge的别名,但是却写成了一个变量
3、解决办法
BEGIN SELECT stuAge AS amount; IF stuAge IS NOT NULL THEN SET stuAge = stuAge + 1; SELECT stuAge AS amount1; ELSE SELECT 20 INTO stuAge; END IF; SELECT stuAge AS amount3; END
时间: 2024-09-27 01:01:27