Home > Database > Mysql Tutorial > body text

在mysql中让数据库中数据成倍增长

WBOY
Release: 2016-06-07 16:19:08
Original
1467 people have browsed it

在项目中有时候需要测试一下数据库的性能或者就是为了测试一下分页效果,如果一条条数据插入,显然效率很低。那么进行批量增加的sql语句为: insert tableName(name,password) select name,password from tablename 有的叫法为表迁移,测试效果图如下: 如果

   在项目中有时候需要测试一下数据库的性能或者就是为了测试一下分页效果,如果一条条数据插入,显然效率很低。那么进行批量增加的sql语句为:

  insert tableName(name,password) select name,password from tablename

  有的叫法为表迁移,测试效果图如下:

在mysql中让数据库中数据成倍增长    三联

  如果表的主键为自增长的话,就把图中的星号换为字段名除了主键(形如 insert t1(column1,column2)select (column1,column2) from t1 )。

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!