码迷,mamicode.com
首页 > 其他好文 > 详细

sdsdsd

时间:2016-04-17 12:54:28      阅读:108      评论:0      收藏:0      [点我收藏+]

标签:

create PROCEDURE b2(in c_year int,in co int)
begin
declare num int;
if exists(select * from class where class="c_year") then
update class set code=code+1 where class="c_year";
else
insert into class(class,code)values(c_year,1);
end if;
select code into num from class where class="c_year";
select CONCAT(c_year,‘0‘,co,lpad(num,3,0)) as code_a;

end;

sdsdsd

标签:

原文地址:http://www.cnblogs.com/mengluo/p/5400595.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!