当前位置:首页 > 数据库 > Mysql

mysql动态表创设

 

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? (目前使用的是这个)

根据区域划分表来拆分数据。

?

?


【说明】本文章由站长整理发布,文章内容不代表本站观点,如文中有侵权行为,请与本站客服联系(QQ:254677821)!

相关教程推荐

其他课程推荐