第16课|第16课 图解变量
文章图片
变量.png 查看系统变量
不写session
, 默认局部变量
文章图片
变量.png 查看全部
show variables;
show session variables;
show global variables;
搜索关键字
show variables like 'auto%';
show variables like 'auto%';
show session variables like 'auto%';
show session variables like 'auto%';
show global variables like 'auto%';
show global variables like 'auto%';
查看单个
select @@autocommit;
select @@session.autocommit;
select @@global.autocommit;
文章图片
修改变量.png 修改系统变量
【第16课|第16课 图解变量】不写session
默认 局部变量
set @@autocommit = 0;
set @@session.autocommit = 0;
set @@global.autocommit = 0;
set autocommit = 0;
set session autocommit = 0;
set global autocommit = 0;
系统变量和用户变量的区别
文章图片
系统变量.png
文章图片
用户变量.png
- 系统变量是mysql自带的, 不用声明即可使用, 当然也不能新增
- 用户可以自己定义的变量, 需要声明才能使用
set @hello = 1;
select @hello;
全局局部变量(
begin end
中有效) 文章图片
创建用户局部变量.png
create procedure test() begin
declare x int default = 0;
select x;
end;
推荐阅读
- 第6.2章(设置属性)
- 2018-02-06第三天|2018-02-06第三天 不能再了,反思到位就差改变
- 第三节|第三节 快乐和幸福(12)
- EffectiveObjective-C2.0|EffectiveObjective-C2.0 笔记 - 第二部分
- android第三方框架(五)ButterKnife
- 开学第一天(下)
- 野营记-第五章|野营记-第五章 讨伐梦魇兽
- 2018年11月19日|2018年11月19日 星期一 亲子日记第144篇
- 第326天
- 跌跌撞撞奔向你|跌跌撞撞奔向你 第四章(你补英语,我补物理)