设为首页 加入收藏

TOP

sql语句如何实现插入不重复的20位字符串(mysql)?
2018-03-18 16:21:46 】 浏览:120
Tags:sql 语句 如何 实现 插入 重复 20位 字符串 mysql

#md5截取15位

delimiter @

DROP PROCEDURE IF EXISTS insert_Table;

create procedure insert_Table(in item integer)

begin

declare counter int;

set counter = item;

while counter >= 0 do

insert into name(uid,name) values(counter, UPPER(concat('ABCDE',LEFT(md5(counter),15))) );

set counter = counter - 1;

end while;

end

@

delimiter @

call insert_Table(1000000);

@

】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
上一篇MySQL中自定义参数的使用教程 下一篇Oracle 建立索引及SQL优化

最新文章

热门文章

Hot 文章

Python

C 语言

C++基础

大数据基础

linux编程基础

C/C++面试题目