sql语句如何实现插入不重复的20位字符串(mysql)?
程序员文章站
2022-05-07 15:09:14
#md5截取15位
delimiter @
DROP PROCEDURE IF EXISTS insert_Table;
create procedure insert_Ta...
#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);
@
上一篇: oracle常用命令
下一篇: 远程连接阿里云上mysql的问题