update change_request cr
inner join application app on cr.app_name = app.app_name
inner join aone_product p on p.aone_product_id = app.aone_product_id
inner join department d on d.dept_no = p.dept_no
set
cr.dept_no = p.dept_no,
cr.dept_name = d.dept_name
where cr.cr_id in (select cr.cr_id from (select * from change_request) cr) and p.dept_no is not null
其中,MySQL中有个很LOW的from问题,你需要这样写:
update request_resource set method = 'X' where id in (SELECT rr.id FROM (select * from request_resource) rr where rr.id < 30);
是不是感觉有点LOW ?
(SELECT rr.id FROM (select * from request_resource)
新版本中,应该改善了。