我的Oracle SQL是新的,我試圖做一個表的下一個方面的更新:我如何使用相同的ID更新Oracle中的多個列?
我有一個表答:
+---------+---------+---------+----------+
| ColumnA | name | ColumnC | Column H |
+---------+---------+---------+----------+
| 1 | Harry | null | null |
| 2 | Harry | null | null |
| 3 | Harry | null | null |
+---------+---------+---------+----------+
和表格B:
+---------+---------+---------+
| name | ColumnE | ColumnF |
+---------+---------+---------+
| Harry | a | d |
| Ron | b | e |
| Hermione| c | f |
+---------+---------+---------+
而且我想更新表A,使結果將是下一個:
+---------+---------+---------+----------+
| ColumnA | name | ColumnC | Column H |
+---------+---------+---------+----------+
| 1 | Harry | a | d |
| 2 | Harry | a | d |
| 3 | Harry | a | d |
+---------+---------+---------+----------+
我怎麼能這樣做?
我得到錯誤「錯誤:ORA-00906:缺少左括號」 – jartymcfly
對不起。我編輯了這篇文章。在表A中,名稱值是相同的(「哈利」,「哈利」,「哈利」)。因此,我想根據名稱值根據表B中列E和F的值填充各個值C和H的值。 – jartymcfly
我粘貼了你測試過的代碼。有用。括號中沒有錯誤。請檢查你在執行什麼 – Kacper