大家好,又见面了,我是全栈君,今天给大家准备了Idea注册码。
http://hovertree.com/menu/mysql/
use abccs;
select * from mytable2 limit 3,4;
call sp_name1(1,@nn);
select @nn;
select length(‘sdaf’);
select sum(1) from mytable2 where mytable2.name=’8′;
select sum_hell(‘abv’);
select * from t;
#描述表t结构
desc t;
#添加一列设置为主键
alter table t add id int,add primary key (id);
#删除列my_order
alter table t drop column my_order;–
alter table t add my_order char(1) default ‘Y’;
#修改表列类型
alter table t modify my_order varchar(10);
alter table t change my_order my_order char(1);
#修改表 列名address1 为id
alter table t change column address1 id int;
#删除存储过程testName
drop procedure testName;
delimiter //
create procedure testName(in name varchar(10),out para varchar(10))
begin
declare deName varchar(10);
#NOT FOUND,SQLEXCEPTION,SQLWARNING
declare continue handler for not found,sqlexception,sqlwarning set @sp2=10;#begin end;
set @sp1=1;
delete from t where id <10;
set @sp1=2;
insert into t values(2,3);
set @sp1=3;
insert into t values(2,3);
set @sp1=4;
select id into para from t;
end;
call testName(2,@a);
select @a, @sp1, @sp2;
//
delimiter //
create procedure testTration()
begin
declare continue handler for not found,sqlexception,sqlwarning rollback;
start transaction;
insert into t values(3,’Y’);
insert into t values(4,’Y’);
commit;
end;
call testTration();
#用户变量
set @cvar=23;
##系统变量
#全局系统变量
set global eee=234
#会话系统变量
set @@var
# 单行注释
— 单行注释
/*
多行注释
eeee
*/
http://www.cnblogs.com/roucheng/p/mysqlhanshu.html
发布者:全栈程序员-用户IM,转载请注明出处:https://javaforall.cn/120487.html原文链接:https://javaforall.cn
【正版授权,激活自己账号】: Jetbrains全家桶Ide使用,1年售后保障,每天仅需1毛
【官方授权 正版激活】: 官方授权 正版激活 支持Jetbrains家族下所有IDE 使用个人JB账号...