生成大量随机数 存入数据库,该如何处理

WBOY
Release: 2016-06-13 10:11:57
Original
950 people have browsed it

生成大量随机数 存入数据库
比如我想1000个10位随机数 然后插入数据库 有没有什么比较高效的方法呢?

------解决方案--------------------
来个PROCEDURE

SQL code
DROP PROCEDURE IF EXISTS `insert`;CREATE PROCEDURE `insert`(num int)BEGINDECLARE i INT;DECLARE var INT;SET i=1;WHILE i<num do set var="FLOOR(RAND()*10000000000);" insert into table values i="i+1;END" while class="clear">
                 
              
              
        
            </num>
Copy after login
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