Home >Backend Development >PHP Tutorial >怎样可以快速sql新建分表呢

怎样可以快速sql新建分表呢

WBOY
WBOYOriginal
2016-06-23 14:13:591078browse

要建500个相同结构的表  有没办法一句sql搞定呢。  命名规则 tab_[1-500]


回复讨论(解决方案)

直接用循环吧

用for循环生成500个create table ..... 语句,保存至xx.sql 文件中,然后导入到mysql中。

写个存储过程,直接调用执行。

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn