UPDATE (SELECT * FROM TB_EMP_CERTIFIC t LEFT JOIN TB_EMP_PERSON p ON t.V_VCH_PERSON_ID=p.V_VCH_PERSON_ID WHERE p.V_VCH_NAME ='王%' AND p.V_DTM_BIRTHDAY < add_months(sysdate,-720)) A SET A.V_CHR_CERTIFIC_STATE='S'
下面是add_months表示大于六十岁
p.V_DTM_BIRTHDAY < add_months(sysdate,-720))
首先去查询
SELECT * FROM TB_EMP_CERTIFIC t LEFT JOIN TB_EMP_PERSON p ON t.V_VCH_PERSON_ID=p.V_VCH_PERSON_ID WHERE p.V_VCH_NAME ='王文义' AND p.V_DTM_BIRTHDAY < add_months(sysdate,-720)
然后把这条查询语句当做A然后对查到所有数据进行批量修改
UPDATE (select查询语句) A SET A.V_CHR_CERTIFIC_STATE='S'