1
如何改進我的查詢,因爲它將超時異常。有人可以幫助我改進查詢...?查詢可以改進,因爲它要超時異常
UPDATE pdtdeliveryTable p SET p.OrderID = IFNULL
(
(SELECT OrderID from OrderTable o where o.DiagramID=p.DiagramID AND o.DeliveryDate=
(
Select min(o2.DeliveryDate) from OrderTable o2 where o2.DiagramId=o.DiagramID Order by o2.DeliveryDate
)Limit 1),0
)
where p.OrderID=0;
@Sarharsh但查詢不conidering最低DeliveryDate其採取的最頂層值的第二個查詢。 – neo