MySQL 编程技巧(一)
工作中我们可能会建立类似的辅助表,并填充一定量的数据来完成工作。例如:生成一连串连续的数值。
表:
create table nums (a int unsigned not null primary key)engine=innodb;
一般的做法是建立一个存储过程:
delimiter $$
create procedure pCreateNums (cnt int unsigned)
begin
declare s int unsigned default 1;
truncate table Nums;
while s
页:
[1]