我在以下查询中遇到错误.. 任何人都可以帮助修复此查询
select c.CHANGE_NUMBER,
(select le.ENTRYVALUE from listentry le
where le.ENTRYID = c.CATEGORY)as CATEGORY ,
(
SELECT last_name || ',' || first_name || '(' || loginid || ')'
FROM agileuser
WHERE id = c.ORIGINATOR
) initiator,(
SELECT last_name || ',' || first_name || '(' || loginid || ')'
FROM agileuser
WHERE id = c.owner
) coordinator, w.state,
(SELECT description
FROM nodetable
WHERE id = w.state
) workflow_status , TO_CHAR(w.LOCAL_DATE,'DD-MON-YY HH24:MI:SS')local_date,
(select
(trunc(to_date(B.local_date, 'DD-MON-YY HH24:MI:SS') - to_date(w.local_date, 'DD-MON-YY HH24:MI:SS')))as timediff
FROM WORKFLOW_PROCESS w INNER JOIN WORKFLOW_PROCESS B ON B.order_by = (w.order_by + 1)
where w.change_id=B.Change_id and w.change_id=9946301 )--ORDER BY w.order_by ASC
from change c, WORKFLOW_PROCESS w
where w.change_id = c.id-- order by w.ORDER_BY)
and c.CHANGE_NUMBER='NPI001084'
order by w.ORDER_BY,local_date ASC
trunc() 查询给出多条记录
select
(trunc(to_date(B.local_date, 'DD-MON-YY HH24:MI:SS') - to_date(w.local_date, 'DD-MON-YY HH24:MI:SS')))as timediff
FROM WORKFLOW_PROCESS w INNER JOIN WORKFLOW_PROCESS B ON B.order_by = (w.order_by + 1)
where w.change_id=B.Change_id and w.change_id=9946301 ORDER BY w.order_by ASC
因此无法与此主查询一起运行。