ITPub博客

首页 > 数据库 > 数据库开发技术 > 批量update 表1的数据,数据从查询中获取

批量update 表1的数据,数据从查询中获取

原创 数据库开发技术 作者:zerocentury 时间:2009-08-20 11:18:38 0 删除 编辑

update cux.gm_js_prices t
set t.start_date = (select pha.start_date
from cux.gm_js_prices gjp, po.po_headers_all pha
where gjp.rqf_header_id = pha.po_header_id
and (gjp.start_date <> pha.start_date or
gjp.end_date <> pha.end_date)
and t.header_id = gjp.header_id)
,t.end_date = (select pha.end_date
from cux.gm_js_prices gjp, po.po_headers_all pha
where gjp.rqf_header_id = pha.po_header_id
and (gjp.start_date <> pha.start_date or
gjp.end_date <> pha.end_date)
and t.header_id = gjp.header_id)
where t.header_id in (
select gjp.header_id
from cux.gm_js_prices gjp, po.po_headers_all pha
where gjp.rqf_header_id = pha.po_header_id
and (gjp.start_date <> pha.start_date or
gjp.end_date <> pha.end_date))

[@more@]

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/341285/viewspace-1026186/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论
  • 博文量
    22
  • 访问量
    623310