1. 用 select MAX(a) into s1 from tablename where tablecolumn=1; 比较省事2. 也可以在TRIGGER中捕获异常,
exception
when no_data_found then
....当然此时select MAX(a) into s1 from tablename where tablecolumn=1;语句后面的SQL就无法执行了,所以采用第一种方式比较好,不过在使用变量s1之前要判断一下是否为空值!
exception
when no_data_found then
....当然此时select MAX(a) into s1 from tablename where tablecolumn=1;语句后面的SQL就无法执行了,所以采用第一种方式比较好,不过在使用变量s1之前要判断一下是否为空值!
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货