【发布时间】:2009-08-05 10:12:41
【问题描述】:
我有两个包含以下字段的表:
table1:OTNAME table2 : SNCODE, description_text
我正在尝试将 table2 的两列添加到 table1 并更新这些列。我的查询是:
alter table table1 add sncode integer
alter table table1 add description_text varchar2(30)
update table1 set
sncode,description_text = (SELECT sncode, description_text
FROM table2, table1
WHERE SUBSTR (otname, INSTR (otname,'.', 1, 3)
+ 1,
INSTR (otname, '.', 1, 4)
- INSTR (otname,'.', 1, 3)
- 1)
= sncode)
我收到一个错误:ORA 00927 - 缺少等于运算符,指向我的更新语句的第二行。感谢有人能指出我正确的方向。
问候,
新手
【问题讨论】: