begin
set @table_sql ='create table cdn';
#set @table_sql = concat(@table_sql,DATE_FORMAT(NOW(), '%Y%m%d%H%i%s'));
set @table_sql = concat(@table_sql,curdate()+1);
set @table_sql = concat(@table_sql,'daycounts');
set @table_sql = concat(@table_sql,"(
id int not null auto_increment comment '自增长',
domain varbinary(500) not null comment '域名',
years int not null comment '年',
months int not null comment '月',
days int not null comment '天',
bandwidth double not null comment '带宽',
cdnip varbinary(30) not null comment 'cdn ip',
primary key (id)
)");
PREPARE stmt1 FROM @table_sql;
EXECUTE stmt1;
end
使用事件创建表
最新推荐文章于 2024-10-26 11:12:48 发布
本文介绍了一种通过SQL语句自动创建CDN流量统计表的方法。该表用于记录特定域名下每天的带宽使用情况,并包括了日期、带宽等关键字段。
1072

被折叠的 条评论
为什么被折叠?



