【发布时间】:2016-11-14 11:22:19
【问题描述】:
以下查询似乎不起作用并给出语法错误:
update const_acad_record
set const_acad_record.education_level = school_category_type.education_level
FROM school_category_type, sch_rec sch_rec
where const_acad_record.organization_ID = sch_rec.id and
sch_rec.ctgry = school_category_type.code
如果我将其转换为子查询,如下所示,它可以工作,但更新的记录数量超过了要求:
update const_acad_record
set education_level = (SELECT education_level
FROM school_category_type sct, sch_rec sr
where const_acad_record.organization_ID = sr.id and
sr.ctgry = sct.code)
(列education_level来自表school_category_type。)
【问题讨论】:
-
Informix 语法手册不包括第一种形式;没有理由认为它会起作用。
标签: informix