sql优化
..这段代码效率极低...如何优化能提高效率呢?
------------------------------------------------
SELECT TMPCORE.PARTNAME,
TMPCORE.GROUPNAME,
'NON-OS ' OSPARTFLG,
TMPCORE.APPLNDESC,
TMPCORE.NATURECD,
TMPVALUE.RESULTCD,
TMPVALUE.THSQUAR,
TMPVALUE.THSQUAR,
TMPVALUE.LSTYEARQUAR
FROM
(
SELECT TMPAPPLN1.PARTNO,
TMPAPPLN1.PARTNAME,
TMPAPPLN1.GROUPNO,
TMPAPPLN1.GROUPNAME,
LPNVAPPLQUA.APPLNCD,
LAPTYPE.APPLNDESC,
LPNVAPPLQUA.NATURECD
-- TMPRESULTCD.RESULTCD
FROM LPNVAPPLQUA,
LNATNCD,
LAPTYPE, -- To get application type.
(SELECT LRPTPRAM.SEQNOLVL1 PARTNO,
LRPTPRAM.TYLVL1 PARTNAME,
LRPTPRAM.SEQNOLVL2 GROUPNO,
LRPTPRAM.TYLVL2 GROUPNAME,
LRPTPRAM.SECTCD,
LRPTPRAM.APPLNCD,
LRPTPRAM.NATURECD,
LRPTPRAM.NATCD,
LRPTPRAM.TDTY,
LRPTPRAM.POLTGRPCD,
LRPTPRAM.NENATCD
FROM LRPTPRAM
WHERE LRPTPRAM.RPTID = 'P354R1W1 '
) TMPAPPLN1 -- To indicate part one and groups within. SECTCD = 'AC ' for part identified.
/* (SELECT 'ASS ' RESULTCD FR