‎2007 Sep 18 11:50 AM
hi,
I have the code given below.
I need to add a field i.e.Table ADCP..field TEL_NUMBER to the existing code.
So, what my question is.. the select statement is already joinng 4 tables.
Now...Can I join one more table (Table ADCP..field TEL_NUMBER )
to the existing code
or
Is there any other way for to add the field??? IF yes..plz tell me clearly
the code is given below.
SELECT EBANAFNAM EBANBADAT EBANBANFN EBANBNFPO EBAN~ERDAT
EBANERNAM EBANFRGGR EBANFRGRL EBANFRGST EBAN~FRGZU
EBANLOEKZ EBANWERKS ZPR_APPR_USERBANFN ZPR_APPR_USERBNFPO
ZPR_APPR_USERFULLNAME1 ZPR_APPR_USERFULLNAME2
ZPR_APPR_USERFULLNAME3 ZPR_APPR_USERFULLNAME4 USR21~BNAME
USR21PERSNUMBER ADRPNAME_TEXT ADRP~PERSNUMBER
INTO (EBAN-AFNAM , EBAN-BADAT , EBAN-BANFN , EBAN-BNFPO , EBAN- ERDAT
, EBAN-ERNAM , EBAN-FRGGR , EBAN-FRGRL , EBAN-FRGST , EBAN-FRGZU
, EBAN-LOEKZ , EBAN-WERKS , ZPR_APPR_USER-BANFN
, ZPR_APPR_USER-BNFPO , ZPR_APPR_USER-FULLNAME1
, ZPR_APPR_USER-FULLNAME2 , ZPR_APPR_USER-FULLNAME3
, ZPR_APPR_USER-FULLNAME4 , USR21-BNAME , USR21-PERSNUMBER
, ADRP-NAME_TEXT , ADRP-PERSNUMBER )
FROM ( EBAN
INNER JOIN ZPR_APPR_USER
ON ZPR_APPR_USERBANFN = EBANBANFN
AND ZPR_APPR_USERBNFPO = EBANBNFPO
INNER JOIN USR21
ON USR21BNAME = EBANERNAM
INNER JOIN ADRP
ON ADRPPERSNUMBER = USR21PERSNUMBER )
WHERE EBAN~AFNAM IN SP$00005
AND EBAN~FRGRL IN SP$00004
AND EBAN~FRGST IN SP$00001
AND EBAN~LOEKZ IN SP$00002
AND EBAN~WERKS IN SP$00003
AND EBAN~ERNAM IN S_ERNAM
AND EBAN~BANFN IN S_BANFN.
PLz suggest what should be the better way?
regards
Vaja
‎2007 Sep 18 11:55 AM
hi mallikarjun,
with respect to the performance wise you need to use upto 3 tables in select stmt using joins.
if the tables are more in number then its better to go for FOR ALL ENTRIES .
first select the data from any 3 tables into one internal table
and using that internal table in FOR ALL ENTRIES clause use remaining db tables in another select stmt.
performance wise its better choice while selecting the data from DB tables.
<b>Reward points if useful</b>
Chandra