MySQL标准变量、临时变量、系统变量
声明标准变量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 ……全局变量@@系统变量,只能读取,不能修改,如@@e
·
声明标准变量
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
更多推荐
已为社区贡献2条内容
所有评论(0)