我需要更新父部件的一个组件(322058-000000')的截止日期,其中有问题的组件与另一个组件一起使用。
下面的代码给出了组件(322058-000000)和需要更改的实例。需要更改它与组件(322123-301200)一起使用的位置。
select * from BomStructure BS
where
Component = '322058-000000' and
exists (select 1 from BomStructure
where ParentPart = BS.ParentPart and Component = '322123-301200');我只想根据上面查询的结果更新组件322058-000000的截止日期。请协助。
发布于 2019-10-23 21:14:59
除非我在这里遗漏了什么,否则假设现有查询的结果是您想要更新的行,那么您只需要将SELECT语句转换为UPDATE语句。
UPDATE BS
SET OffDate = <The value you need here>
from BomStructure BS
where
Component = '322058-000000' and
exists (select 1 from BomStructure
where ParentPart = BS.ParentPart and Component = '322123-301200');https://stackoverflow.com/questions/58523564
复制相似问题