首页 > 数据库 > MySQL > MySQL的@与@@区别
MySQL的@与@@区别
@x 是 用户自定义的变量 (User variables are written as @var_name)
@@x 是 global或session变量 (@@global @@session )
参考:6.1.4 Server System Variables
select @@log_error;
mysql> SET @t1=0, @t2=0, @t3=0;
mysql> SELECT @t1:=(@t2:=1)+@t3:=4,@t1,@t2,@t3;
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/16976507/viewspace-2132961/ ,如需转载,请注明出处,否则将追究法律责任。