我收到錯誤:運行下面的語句時無法在源表中獲取穩定的一組行。錯誤:ORA-30926:無法在源表中獲得一組穩定的行
merge into table_1 c
using (select rep_nbr, T_nbr, SF from table_2) b
on (c.rep_id=b.rep_nbr)
when matched then
update set
c.T_ID =b.T_nbr,
c.SF=b.SF
when not matched then
insert(T_id, SF)
values(null, null);
當我rep_nbr之前把不同
merge into table_1 c
using (select distinct rep_nbr,t_nbr,SF from table_2) b
on (c.rep_id=b.rep_nbr)
when matched then
update set
c.T_ID =b.T_nbr,
c.SF=b.SF
when not matched then
insert(T_id, SF)
values(null, null);
ORA-01400:無法將NULL插入c.rep_id。 我不想填充c.rep_id,我只需要它們匹配,然後更新匹配的記錄。
那麼是什麼阻止你刪除的查詢?如果不匹配的最後一段.... – Mihai
@mihai我想這是沒有必要有部分。將它拿出來有所作爲嗎? – JohnD
如果您只需要更新yes。在最後一個查詢中,prob可能會將空值插入非空列中。 – Mihai