这是 Informix 更新的正确语法吗?
update table1
set table1.code = 100
from table1 a, table2 b, table3 c
where a.key = c.key
a.no = b.no
a.key = c.key
a.code = 10
b.tor = 'THE'
a.group = 4183
a.no in ('1111','1331','1345')
我收到通用 -201“发生语法错误”消息,但我看不出出了什么问题。
不幸的是,接受的答案会导致 Informix Dynamic Server Version 11.50 中出现语法错误。
这是避免语法错误的唯一方法:
update table1
set code = (
select 100
from table2 b, table3 c
where table1.key = c.key
and table1.no = b.no
and table1.key = c.key
and table1.code = 10
and b.tor = 'THE'
and table1.group = 4183
and table1.no in ('1111','1331','1345')
)
BTW, to 获取 Informix 版本,运行以下 SQL:
select first 1 dbinfo("version", "full") from systables;
Updated:另见这个答案.
Updated:另见the docs.
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)