爲什麼我會收到錯誤消息?爲什麼我收到錯誤ORA-01427:單行子查詢返回多行
ORA-01427:單行子查詢返回不止一行與此查詢
UPDATE JOB_TASK JT1
SET JT1.job_task_status_id =
(SELECT JTS1.JOB_TASK_STATUS_ID
FROM MAXIMO_WO MW1
INNER JOIN job_task_status jts1
ON MW1.STATUS = jts1.description
INNER JOIN JOB_TASK JT1
ON jt1.job_task_id = mw1.wonum)
WHERE JT1.JOB_TASK_STATUS_ID IN
(SELECT JTS.JOB_TASK_STATUS_ID
FROM JOB_TASK_STATUS JTS,
JOB_TASK JT,
MAXIMO_WO MW,
WORK_ORDER_CONTROL WOC
WHERE JT.JOB_TASK_ID = MW.WONUM
AND JT.JOB_TASK_STATUS_ID = JTS.JOB_TASK_STATUS_ID
AND JT.WORK_ORDER_ID = WOC.WORK_ORDER_ID
and jt.job_task_id = mw.wonum
AND MW.STATUS IN
('APPR',
'SCHED',
'INPRG',
'FNACCEPT',
'WMATL',
'WKCOMP',
'COMP')
AND WOC.COMPANY_ID = '21'
AND MW.SITEID <> 'NUCDEV'
AND DECODE (
INSTR (JTS.DESCRIPTION, '-', 1),
0, JTS.DESCRIPTION,
SUBSTR (JTS.DESCRIPTION,
1,
(INSTR (JTS.DESCRIPTION, '-', 1) - 1))) <>
MW.STATUS
AND JT.LEVEL_NUMBER = '3'
AND MW.STATUSDATE < SYSDATE - 1
AND MW.WONUM <> 'UNDEFINED')
因爲你的子查詢返回多個行。 – swasheck 2013-04-10 15:55:51
如果你從'SET'運行'SELECT',你會返回多少行? – Taryn 2013-04-10 15:56:48
@swasheck你能爲此展示一些證據嗎? – Kermit 2013-04-10 15:58:02