我今天在用 merge into update 操作时批量更新 报ora-30926 无法在源表中获得一组稳定的数据
具体sql
if iflage = 1 then
-- dbms_output.put_line(iflage);
merge into res_fourtwoproject res
using (select * from CORRECTLY_RES_FOURTWOPROJECT s where s.batch=p_batch) c --按照某个条件查询数据集
on (res.IYEAR=years and res.SWEEKNUM = weeks and res.SSITENAME = c.SSITENAME)
when matched then --存在就更新
update set
res.SCOMPANYNAME=c.SCOMPANYNAME,
res.SLISTTYPE = c.SLISTTYPE,res.STHREETOONEUNIQUE=c.STHREETOONEUNIQUE,
--res.STHREETOONEUNIQUE=c.STHREETOONEUNIQUE,
求大神救我,跪谢
using (select * from CORRECTLY_RES_FOURTWOPROJECT s where s.batch=p_batch) 这条语句如果查出来的是个集合就有问题,如果是单条数据的话就没问题
merge into 不知道?