insert into table(num) values(max(num)+1)这样为什么不行呢?
后来我写了一个存储过程BEGIN
declare maxnum tinyint;
select max(num) as maxnum from t_d_license;
if maxnum IS NULL then
set maxnum=0;
end if; insert into t_d_license(num)
values(maxorder+1);END还是不行,插入的num值都是1
(我的mysql是5.1版本的)
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货