oracle 我在plsql developer里面自己编写的语句 为什么在explain plan窗口可行 但是真正执行却执行不出来
UPDATEBUS01SET(BUS_START,BUS_END)=(SELECTBUS_START,BUS_ENDFROMBUS_TOTALWHEREBUS01.BUS...
UPDATE BUS01
SET (BUS_START, BUS_END) = (SELECT BUS_START, BUS_END
FROM BUS_TOTAL
WHERE BUS01.BUS_ID = BUS_TOTAL.BUS_ID)
WHERE BUS_ID IN (SELECT BUS_ID FROM BUS_TOTAL);
就是这一句 展开
SET (BUS_START, BUS_END) = (SELECT BUS_START, BUS_END
FROM BUS_TOTAL
WHERE BUS01.BUS_ID = BUS_TOTAL.BUS_ID)
WHERE BUS_ID IN (SELECT BUS_ID FROM BUS_TOTAL);
就是这一句 展开
2个回答
展开全部
原因: WHERE BUS_ID IN (SELECT BUS_ID FROM BUS_TOTAL);出多行。
实例:
UPDATE BUS01
SET (BUS_START, BUS_END) = (SELECT BUS_START, BUS_END
FROM BUS_TOTAL
WHERE BUS01.BUS_ID = BUS_TOTAL.BUS_ID)
WHERE EXISTS
(SELECT 1 FROM BUS_TOTAL WHERE BUS01.BUS_ID = BUS_TOTAL.BUS_ID)
实例:
UPDATE BUS01
SET (BUS_START, BUS_END) = (SELECT BUS_START, BUS_END
FROM BUS_TOTAL
WHERE BUS01.BUS_ID = BUS_TOTAL.BUS_ID)
WHERE EXISTS
(SELECT 1 FROM BUS_TOTAL WHERE BUS01.BUS_ID = BUS_TOTAL.BUS_ID)
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询