Home > Database > Mysql Tutorial > mysql数据表添加海量数据和删除海量数据 代码实现_MySQL

mysql数据表添加海量数据和删除海量数据 代码实现_MySQL

WBOY
Release: 2016-06-01 13:12:13
Original
1012 people have browsed it

今天需要测试大量的增删改查,但是数据表中数据来源成了一大问题,网上一搜大家也遇到同样的问题。

普遍推荐方法有:

1、在excel添加,然后导入到数据表(可行但是有点麻烦)

2、自己手动添加(受不了,把人逼疯)

3、运用程序循环添加数据(很方便实用)

下面小弟来简单谈谈第三种情况:


还是直接举个栗子吧,


DROP PROCEDURE  IF EXISTS KM;//每次都需要删除km方法,不然程序第二次执行不了create procedure km()//创建一个km方法begin    declare i int;    set i=0;    while i<p></p><p><strong>同理删除多个也可以利用循环(下面依据id来删除)</strong><br></p><p></p><pre class="brush:php;toolbar:false">DROP PROCEDURE  IF EXISTS KM;create procedure km()begin    declare i int;    set i=100;    while i<br><br>
    
Copy after login
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