首页 新闻 会员 周边 捐助

关于sybase数据表,单表更新的问题

0
悬赏园豆:30 [已关闭问题] 关闭于 2014-03-15 10:17

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类型的)

zl_说不得的主页 zl_说不得 | 初学一级 | 园豆:33
提问于:2014-03-13 16:17
< >
分享
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册