11-27-2008 4:24 AM
hi,
how many innerjoin can be used in single select query.
regards,
ARUN
11-27-2008 4:28 AM
Hi Arun,
I think we can do three .even more.
but it gives performance issue better go for for all entries
Regards
11-27-2008 4:27 AM
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
11-27-2008 4:28 AM
Hi Arun,
I think we can do three .even more.
but it gives performance issue better go for for all entries
Regards
11-27-2008 4:32 AM
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
11-27-2008 4:50 AM
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.
11-27-2008 5:11 AM
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.
Thanks
Nitesh
12-18-2008 7:48 AM