BEGIN
SET @count=2;
CASE
WHEN @count=1 THEN
SET @count = 11;
WHEN @count=2 THEN
SET @count=12;
ELSE #相当于default
SET @count=1;
END CASE;
SELECT @count;
END
MySQL存储过程-CASE
最新推荐文章于 2024-07-27 21:51:16 发布
BEGIN
SET @count=2;
CASE
WHEN @count=1 THEN
SET @count = 11;
WHEN @count=2 THEN
SET @count=12;
ELSE #相当于default
SET @count=1;
END CASE;
SELECT @count;
END