SELECT *
FROM
(
SELECT REL_ID,A_NBR,A_ID,P_TYPE,A_TITLE,A_TYPE,A_STATUS,S_DATE,
M_ID,D_FLAG,M_TYPE,I_ID,C_DATE,R_NBR() OVER() as R_NBR
FROM DB2INST1.TABLE1
LEFT JOIN DB2INST1.TABLE2
ON TABLE1.A_NBR = TABLE2.A_NBR
AND TABLE2.S_ID = 800
WHERE S_ID = 800
AND REL_ID = 7100
AND A_STATUS NOT = 15
AND TABLE2.A_NBR IS NULL
)AS X
WHERE R_NBR BETWEEN 1 AND 15
FOR READ ONLY WITH UR
|