声明标准变量

DECLARE end_flag INT DEFAULT 0;

临时变量@(不需要声明)

只在局部起作用

用法一:set @name=value;

set @num=1; 
set @num:=1;

用法二:select @num=value;

select @num:=1; 
select @num:=字段名 from 表名 where ……

全局变量@@
系统变量,只能读取,不能修改,如@@error

Logo

更多推荐