update eoo.eoo_data_report e set sys =( select bys from eoo.eoo_data_report t where t.data_time= convert(numeric,'201401')
and t.index_id = e.index_id and t.report_id= convert(numeric,'1') and t.company_id=e.company_id) where e.data_time = convert(numeric,'201402')
执行不成功,提示的意思貌似是不能存在 e ,只好这样来做了:
update eoo.eoo_data_report set sys =( select bys from eoo.eoo_data_report t where t.data_time= convert(numeric,'201401')
and t.index_id = eoo.eoo_data_report.index_id and t.report_id= convert(numeric,'1') and t.company_id=eoo.eoo_data_report.company_id) where eoo.eoo_data_report.data_time = convert(numeric,'201402')
另外numeric这个字段好模糊,convert(int,'201402')同样能执行(datetime是int类型的)