select dwi.workflowitem, dw.workflow as ww_id
from d_workflowitems dwi
join d_workflows dw
on dw.id = dwi.workflow
where dwi.workflow = p_wf_id
and dwi.status not in (1, 7)
and dwi.workflowitem not in
(select closewf.excluded_workflowitem
from aax2sw.k_close_workflows closewf
where closewf.workflow = dw.workflow)
order by dwi.id;
像以上的語法
如果用JPQL寫
請勿將括號中的東西分到另外一個Repo中寫
因為當括號中取不出來的時候
not in() 沒東西, 會發生sql敘述句不完整問題
沒有留言:
張貼留言