будет (база ORACLE 12.2)
SELECT vba~vbeln
FROM vbak AS vba JOIN vbuk AS vbu
ON vba~vbeln EQ vbu~vbeln
INTO TABLE lt_orders
WHERE vba~vbeln IN ms_scr-s_ordn
AND vba~auart IN ms_scr-ord_auart
AND vba~audat IN ms_scr-ord_audat
AND vba~kunnr IN ms_scr-ord_kunnr
AND vba~erdat IN ms_scr-ord_erdat
AND vba~ernam IN ms_scr-ord_ernam
AND vba~vtweg IN ms_scr-ord_vtweg
AND vbu~gbstk IN ms_scr-ord_gbstk
AND vbu~lfstk IN ms_scr-ord_lfstk
AND vbu~fksak IN ms_scr-ord_fksak
AND vbu~cmgst IN ms_scr-ord_cmgst
AND vbu~uvals IN ms_scr-ord_uvals
AND EXISTS (
SELECT vbeln FROM vbpa
WHERE vbeln = vba~vbeln
AND posnr = '000000'
AND parvw = 'WE'
AND kunnr IN ms_scr-ord_kunwe
AND land1 IN ms_scr-ord_land1
).
====vs====
SELECT vba~vbeln
FROM vbak AS vba JOIN vbuk AS vbu
ON vba~vbeln EQ vbu~vbeln
join vbpa as vbp on
vba~vbeln eq vbp~vbeln
INTO TABLE lt_orders
WHERE vba~vbeln IN ms_scr-s_ordn
AND vba~auart IN ms_scr-ord_auart
AND vba~audat IN ms_scr-ord_audat
AND vba~kunnr IN ms_scr-ord_kunnr
AND vba~erdat IN ms_scr-ord_erdat
AND vba~ernam IN ms_scr-ord_ernam
AND vba~vtweg IN ms_scr-ord_vtweg
AND vbu~gbstk IN ms_scr-ord_gbstk
AND vbu~lfstk IN ms_scr-ord_lfstk
AND vbu~fksak IN ms_scr-ord_fksak
AND vbu~cmgst IN ms_scr-ord_cmgst
AND vbu~uvals IN ms_scr-ord_uvals
AND vbp~posnr = '000000'
AND vbp~parvw = 'WE'
AND vbp~kunnr IN ms_scr-ord_kunwe
AND vbp~land1 IN ms_scr-ord_land1.
можем сравнить результаты по join vs exist?
насколько быстрее?
Обсуждают сегодня