【发布时间】:2021-04-22 14:36:02
【问题描述】:
为糟糕的标题道歉。不知道如何简洁地表达我的需求。我知道 MySQL 可以解决这个问题,但它不适用于 Oracle
我有一个表格,其中我的 OrderID 字段与订单上的订单项不同。当用户从订单中删除某些行项目并批准订单时,我会获得已批准行项目的完成日期,以及已删除行项目的空值。我需要更新该订单上所有行的完成日期。这就是它的样子
这就是我要找的东西
如果我选择特定的 OrderID,我发现代码会更新,但如果我打开它扫描整个表,则需要 35 小时(显然不可行)
update batchmgr.udt_buyer a set a.completedate=(select b.completedate from batchmgr.udt_buyer b where b.completedate is not null and b.orderid=a.orderid) where a.orderid ='221292540';
【问题讨论】: