Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Inner join

former_member224008
Active Participant
0 Kudos

hi,

how many innerjoin can be used in single select query.

regards,

ARUN

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi Arun,

I think we can do three .even more.

but it gives performance issue better go for for all entries

Regards

6 REPLIES 6

Former Member
0 Kudos

you can use more than one inner join.

and you can use more than 1 table

its alwayas a good practice not to combine more than 4 tables

Edited by: AD on Nov 27, 2008 6:14 AM

Former Member
0 Kudos

Hi Arun,

I think we can do three .even more.

but it gives performance issue better go for for all entries

Regards

Former Member
0 Kudos

hi

yes you can use inner join for 3 tables.check this for inner join on 3 tables

http://www.sap-img.com/abap/inner-joins.htm

this should help you

regards

Aakash Banga

Former Member
0 Kudos

Hi,

U can use more than one inner join. If u use more than 3 inner joins it will be a performence issue,

See below sample code,

SELECT a~anlage

b~devloc

cequnr cserge cmatnr csernr

FROM eastl AS a

INNER JOIN egerh AS b

ON alogiknr EQ blogiknr

INNER JOIN equi AS c

ON bequnr EQ cequnr

INTO TABLE li_device

FOR ALL ENTRIES IN li_ocm

WHERE a~anlage EQ li_ocm-anlage AND

a~ab LE ws_last_day_month AND

a~bis GE ws_last_day_month AND

b~devloc NE space AND

c~serge IN s_device.

Let me know if u have any other issues,

Regards,

Kusuma.

Former Member
0 Kudos

Hi Arun,

There is basically no limit on that. You can use inner joins for 'N' number of tables. But Rememer that join may worse your performance.

Be careful with inner join, it's a good solution when you have the relation 1<->n but not with relation

n <-> n.

Do check this Link for performance analysis.

https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/86a0b490-0201-0010-9cba-fd5c804b...

Thanks

Nitesh

former_member224008
Active Participant
0 Kudos

thanks for all