SELECT
hi_proins0.PROC_INST_ID_ processId,
act_re_procdef.NAME_ processName,
(
#Unknown column 'hi_proins0.PROC_INST_ID_' in 'where clause'
SELECT IFNULL(ct,0) FROM (
SELECT COUNT(*) FROM act_hi_taskinst hi_task1
INNER JOIN act_hi_procinst hi_proins1
ON hi_task1.PROC_INST_ID_ = hi_proins1.PROC_INST_ID_
WHERE hi_proins1.PROC_INST_ID_ = hi_proins0.PROC_INST_ID_
AND hi_task1.ASSIGNEE_ != hi_proins1.START_USER_ID_
AND hi_task1.ASSIGNEE_ = hi_task0.ASSIGNEE_
GROUP BY hi_task1.ASSIGNEE_
) ti
) approvalNodeCount,
(
...
) spendTime FROM
act_hi_taskinst hi_task0
LEFT JOIN act_hi_procinst hi_proins0 ON hi_proins0.PROC_INST_ID_ = hi_task0.PROC_INST_ID_
INNER JOIN act_re_procdef ON act_re_procdef.ID_ = hi_proins0.PROC_DEF_ID_
GROUP BY hi_proins0.PROC_INST_ID_
它在'where子句'中抛出未知列'hi_proins0.PROC_INST_ID_' 在
SELECT IFNULL(ct,0) FROM (
...
) ti
并且ifnull在上面不起作用
如何解决? :d
答案 0 :(得分:0)
试试这个:
SELECT hi_proins0.PROC_INST_ID_ processId, act_re_procdef.NAME_ processName,
IFNULL((SELECT COUNT(*) FROM act_hi_taskinst hi_task1
INNER JOIN act_hi_procinst hi_proins1 ON hi_task1.PROC_INST_ID_ = hi_proins1.PROC_INST_ID_
WHERE hi_proins1.PROC_INST_ID_ = hi_proins0.PROC_INST_ID_ AND
hi_task1.ASSIGNEE_ != hi_proins1.START_USER_ID_ AND hi_task1.ASSIGNEE_ = hi_task0.ASSIGNEE_
GROUP BY hi_task1.ASSIGNEE_
), 0 ) approvalNodeCount,
(
...
) spendTime
FROM act_hi_taskinst hi_task0
LEFT JOIN act_hi_procinst hi_proins0 ON hi_proins0.PROC_INST_ID_ = hi_task0.PROC_INST_ID_
INNER JOIN act_re_procdef ON act_re_procdef.ID_ = hi_proins0.PROC_DEF_ID_
GROUP BY hi_proins0.PROC_INST_ID_