java_j_1
James_湖人总冠军
2018-12-18 17:02

这句sql哪里有问题,大神帮忙看看

  • mysql

create or replace trigger USERSS_ID before insert on USERINFO
for each row
declare
temp number;
begin
select case
when max(id)<>0 then max(id)+1
else 1
end
into temp from UserInfo;
select temp into :new.id from dual;
end;

  • 点赞
  • 回答
  • 收藏
  • 复制链接分享

2条回答