下面的查詢似乎不工作,並給語法錯誤:Informix的更新加入
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語法手冊不包含第一種形式;沒有理由認爲它會起作用。 –