现有查询:
SELECT
SUBSTR(B.C_TYP, 1, 4)
,SUBSTR(B.X_DESC, 1, 25)
,SUBSTR(A.C_TYP, 5, 4)
,SUBSTR(A.X_DESC, 1, 25)
,SUBSTR(A.X_DESC, 82, 11) FROM M.MASCTAB A, M.MASCTAB B WHERE
A.I_PLT = ?
AND A.N_TBL = ?
AND A.C_TYP LIKE ?
AND A.I_PLT = B.I_PLT
AND SUBSTR(A.C_TYP, 1, 4) = SUBSTR(B.C_TYP, 1, 4)
AND SUBSTR(A.X_DESC, 81, 1) = 'W'
AND B.N_TBL = 'DEPTC'
ORDER BY A.C_TYP
修改后的查询:
SELECT
(SELECT SUBSTR(C_TYP, 1, 4)
FROM M.MASCTAB
WHERE I_PLT = A.I_PLT
AND N_TBL = 'DEPTC'
AND LEFT(C_TYP, 4) = LEFT(A.C_TYP, 4)
)
,(SELECT SUBSTR(X_DESC, 1, 25)
FROM M.MASCTAB
WHERE I_PLT = A.I_PLT
AND N_TBL = 'DEPTC'
AND LEFT(C_TYP, 4) = LEFT(A.C_TYP, 4)
),SUBSTR(A.C_TYP, 5, 4)
,SUBSTR(A.X_DESC,1, 25)
,SUBSTR(A.X_DESC, 82, 11)
FROM M.MASCTAB A
WHERE A.I_PLT = ?
AND A.N_TBL = ?
AND A.C_TYP LIKE ?
AND SUBSTR(A.X_DESC, 81, 1) = 'W'
ORDER BY A.C_TYP
WITH UR
优化查询后,具有准确的结果集,部署代码后面临问题。错误 _jspService 错误类 java.lang.NullPointerException
会有什么问题?请帮忙。