码迷,mamicode.com
首页 > 数据库 > 详细

mysql 更新数据

时间:2017-09-23 15:19:23      阅读:166      评论:0      收藏:0      [点我收藏+]

标签:exist   sch   procedure   blog   and   mysq   mat   roc   format   

 1 drop PROCEDURE IF EXISTS AddIsDoliday ;
 2 CREATE PROCEDURE AddIsDoliday()
 3 BEGIN
 4 IF NOT EXISTS (SELECT * FROM information_schema.columns WHERE table_schema = DATABASE() AND table_name = t_fee_static AND column_name = IsDoliday) THEN
 5 ALTER TABLE t_fee_static ADD IsDoliday int(4) DEFAULT 0 COMMENT 是否节假日(1:是;0否;) AFTER ticketTimeType; 
 6 END IF; 
 7 IF NOT EXISTS (SELECT * FROM information_schema.columns WHERE table_schema = DATABASE() AND table_name = t_fee_type AND column_name = IsDoliday ) THEN
 8 ALTER TABLE t_fee_type ADD IsDoliday int(4) DEFAULT 0 COMMENT 是否节假日(1:是;0否;) AFTER IsDelete;
 9 END IF;
10 
11 end ;
12 call AddIsDoliday();
13 drop PROCEDURE IF EXISTS AddIsDoliday;

 

mysql 更新数据

标签:exist   sch   procedure   blog   and   mysq   mat   roc   format   

原文地址:http://www.cnblogs.com/sumg/p/7581115.html

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