SELECT ID,FORMNAME,NODENAME,SEQUENCE, NAME, STATE, NOWTIMES,
WORK.FQREALNAME||‘(‘||FQDEPT.FULLNAME||‘)‘ AS FQREALNAME,
NVL2(WORK.BHREALNAME,WORK.BHREALNAME||‘(‘||BHDEPT.FULLNAME||‘)‘,‘‘) AS BHREALNAME
FROM OA_WF_BHWORKFLOW WORK
LEFT OUTER JOIN (SELECT FULLNAME,USERID FROM SYS_USER USERNAME LEFT OUTER JOIN SYS_ORGANIZATION DEPT ON USERNAME.DEPARTMENTID=DEPT.ORGANIZATIONID )FQDEPT
ON FQDEPT.USERID=WORK.FQUSERNAME
LEFT OUTER JOIN (SELECT FULLNAME,USERID FROM SYS_USER USERNAME LEFT OUTER JOIN SYS_ORGANIZATION DEPT ON USERNAME.DEPARTMENTID=DEPT.ORGANIZATIONID )BHDEPT
ON BHDEPT.USERID=WORK.BHUSERNAME
WHERE
YJBOBJECTID=‘$YJBOBJECTID$‘
ORDER BY SEQUENCE DESC
拼接sql ()
2023-12-20 09:06:45
上一篇:MySQL查询优化