테이블 8개정도 INNER JOIN 할때요..
어떻하면 쉽고 빠르게 검색할까요..
JOIN 작성도 쉽지가 않네요..
ㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠ
댓글 4
-
숟가락맨
2007.11.17 01:01
-
바위
2007.11.17 01:06
8개는 감히 엄두도 못내봤는데 -0-
차다리 View를 만드시는게..-_-;;
-
Lora
2007.11.17 01:12
뷰를 만드는 방법이 있었네요~생각 못했는데 감사드려요~^ ^
-
지의
2007.11.17 01:13
참고하세요.
SELECT mr~spart AS spart_sr mr~matkl AS matkl_sr rk~land1 AS land1_sr
rk~vbeln AS vbeln_iv rp~posnr AS posnr_iv
ap~erdat AS erdat_so
kp~erdat AS erdat_kp kp~wadat_ist AS wadat_kp
rk~fkdat AS fkdat_iv
ip~adate AS adate_id
ep~edatu AS edatu_rd
rp~fkimg AS fkimg_iv
ak~vbeln AS vbeln_so ap~posnr AS posnr_so
ak~vbeln AS objectid
ak~bstnk AS bstnk_bk
uk~cmgst AS cmgst_cr
INTO CORRESPONDING FIELDS OF TABLE disp_t
FROM vbrk AS rk INNER JOIN vbrp AS rp
ON rk~mandt EQ rp~mandt
AND rk~vbeln EQ rp~vbeln
INNER JOIN lips AS ps
ON rp~mandt EQ ps~mandt
AND rp~vgbel EQ ps~vbeln
AND rp~vgpos EQ ps~posnr
INNER JOIN likp AS kp
ON ps~mandt EQ kp~mandt
AND ps~vbeln EQ kp~vbeln
INNER JOIN zledipod AS ip
ON kp~mandt EQ ip~mandt
AND kp~vbeln EQ ip~vbeln
INNER JOIN vbak AS ak
ON ps~mandt EQ ak~mandt
AND ps~vgbel EQ ak~vbeln
INNER JOIN vbap AS ap
ON ps~mandt EQ ap~mandt
AND ps~vgbel EQ ap~vbeln
AND ps~vgpos EQ ap~posnr
INNER JOIN mara AS mr
ON ps~mandt EQ mr~mandt
AND ps~matnr EQ mr~matnr
INNER JOIN vbuk AS uk
ON ak~mandt EQ uk~mandt
AND ak~vbeln EQ uk~vbeln
INNER JOIN vbep AS ep
ON ap~mandt EQ ep~mandt
AND ap~vbeln EQ ep~vbeln
AND ap~posnr EQ ep~posnr
WHERE rk~vbeln > ''
AND rk~fkart EQ c_fkart
AND rk~vkorg EQ c_vkorg
AND rk~fkdat IN r_fkdat
AND rk~kunrg EQ c_kunrg
AND rk~vbund EQ c_vbund
AND rk~fksto EQ space
AND rp~vbeln > ''
AND rp~posnr > ''
AND rp~werks IN s_werks
AND rp~vstel IN s_vstel
AND kp~vbeln > ''
AND ps~vbeln > ''
AND ps~posnr > ''
AND mr~matnr > ''
AND mr~spart IN s_spart
AND mr~matkl IN s_matkl
AND ip~vbeln > ''
AND ip~adate NE '00000000'
AND ak~vbeln > ''.
테이블에..8개까지..조인하나요?..저희 모듈쪽엔..그정도까진 안하던데...
많아봐야..4개정도던데....
검색조건으로..인덱스위주로 넣어줘야 하지 않나요? ㅎ...글게까지 안해봐서 잘몰겠네요..;;