SELECT
with JOIN
always performs better than nested selects.
Noncompliant code example
SELECT * FROM SPFL INTO SPFLI_WA.
SELECT * FROM SFLOGHT INTO SFLIGHT_WA
WHERE CARRID = SPFLI_WA-CARRID
AND CONNID = SPFLIGHT_WA_CONNID.
ENDSELECT.
ENDSELECT.
Compliant solution
SELECT * INTO WA
FROM SPFLI AS P INNER JOIN SFLIGHT AS F
ON P~CARRID = F~CARRID AND
P~CONNID = F~CONNID.
END-SELECT.