前几天在用ORACLE的DECODE命令时候遇到点麻烦
本来是判断一个表中是否存在此数据,如果有就更新如果没有就添加
语句如下:
meger into table a
using ( select id from table where id=:ID) b
on a.id=b.id
when matched then
update............................
when not matched then
insert into ............................
但是在实际下, select id from table where id=:ID如果为空的话就会报错的
using 的条件不能为空