BEGIN
DECLARE i int default 0;
DECLARE username VARCHAR(256);
WHILE i<100 DO
if i<10 THEN
set username = CONCAT('0101100',i);
elseif i<100 THEN
set username = CONCAT('010110',i);
END if;
INSERT INTO `tb_user` (`USERNAME`) VALUES (username);
set i = i+1;
END WHILE;
END
网友评论