我對SQL很陌生,並且遇到了代碼問題。我一直試圖在表格中複製一行並替換記錄的一部分。不過,我不斷收到錯誤:SQL複製和替換記錄
ORA-00907: missing right parenthesis
下面的代碼提供了錯誤:
insert into mi_structure
select replace parent_mi_id, (child_mi_id,'GR','GR_V') child_mi_id, startdate, enddate, mutnr
from mi_structure
where parent_mi_id like 'MIPFV%29'
and sysdate between startdate and enddate;
用下面的代碼表mi_structure看起來像這樣
select *
from mi_structure
where parent_mi_id like 'MIPFV%29'
and sysdate between startdate and enddate;
PARENT_MI_ID || CHILD_MI_ID || STARTDATE || ENDDATE || MUTNR
MIPFV_POOL 29 || CSLLXXXX.USD.GR || 42917 || 36526 || 11
我在做什麼錯誤?
'(child_mi_id,'GR','GR_V')'寫成函數但不是。可能這會導致錯誤。 –
你想使用替換功能嗎?它使用像這樣 REPLACE('Atestword','word','Phrase'); = AtestPhrase – Moudiz