您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息
免费发信息
三六零分类信息网 > 保山分类信息网,免费分类信息发布

mysql 动态表创设

2024/3/2 19:28:35发布27次查看
mysql 动态表创建 mysql 动态表创建 ,首先要检测是否存在。 使用sql语句: ? ? 1. show ? tables ? like ? '%tb_bp_d_case%'; 2. select `table_name` from `information_schema`.`tables` where `table_schema`='dbname'?and `table_name`='tablename'?;
mysql 动态表创建
mysql 动态表创建 ,首先要检测是否存在。
使用sql语句:
?
?
1. show ? tables ? like ? '%tb_bp_d_case%';
2. select `table_name` from `information_schema`.`tables` where `table_schema`='dbname'?and `table_name`='tablename'?;
3. 如果表不存在就建立这个表,那么可以直接用?create?table?if?not?exists?tablename?这样的指令来建立,不需要先去查询表是否存在。
4. 从模板表创建表:create table if not exists like old_table_name? (目前使用的是这个)
根据区域划分表来拆分数据。
?
?
保山分类信息网,免费分类信息发布

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录