cancel
Showing results for 
Search instead for 
Did you mean: 

fetch data from 3 tables (join vs select)

Former Member
0 Kudos

hi all...

i have to fetch data from three tables having one field common.

should i go with join or using three select statements..

which one is better.. plz clarify..

thanks in advance.

regards.

View Entire Topic
former_member188685
Active Contributor
0 Kudos

Hi,

Use for all entries, what are the tables...


select field1
       field2
       from table
       into table itab.
if sy-subrc = 0. "this is must ot table initial check
select field2
       field3
       from table2
    for all entries in itab
       into table itab2
where field2 = itab-field2.
select field2
       field5
       from table3
     for all entries in itab
       into table itab3
where field2 = itab-field2.

endif.