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: 

LEFT AND RIGHT JOIN??

Former Member
0 Kudos

Hi,

how can I do left and right join(CROSS JOIN)?

Thanks.

1 ACCEPTED SOLUTION

Lakshmant1
Active Contributor
0 Kudos

Hi Huseyin,

Have a look at demo programs

DEMO_SELECT_INNER_JOIN

DEMO_SELECT_LEFT_OUTER_JOIN

Hope this helps.

Thanks

Lakshman

5 REPLIES 5

former_member184495
Active Contributor
0 Kudos

hi,

to my knowledge, abap opensql supports only

'inner join' and 'left outer join'.

dont forget to reward points ,

and if you have something to share, please do.

cheers,

Aditya.

0 Kudos

Hi,

I agree with Aditya.. here is an example SELECT..


   select a~objid a~sobid a~endda
           b~stext
           c~chara
              into table t_quals
              from ( hrp1001                 as a
                    left outer join hrp1000 as b on a~objid  = b~objid
                                      and          a~otype   = b~otype )
                        inner join hrpad31 as c on a~adatanr = c~adatanr
             where a~otype  = c_type_q
               and a~plvar  = c_plvar
               and a~rsign  = c_rsign_b
               and a~relat  = c_relat_032
               and a~istat  = c_istat
               and a~endda >= w_begda
               and a~endda <= w_endda.

Regards,

Suresh Datti

Former Member
0 Kudos

Lakshmant1
Active Contributor
0 Kudos

Hi Huseyin,

Have a look at demo programs

DEMO_SELECT_INNER_JOIN

DEMO_SELECT_LEFT_OUTER_JOIN

Hope this helps.

Thanks

Lakshman

Clemenss
Active Contributor
0 Kudos

maybe somebody can explain the logical differemces between the join type. I.E. I never heard of RIGHT or CROSS joins. Maybe I'm wrong but I think LEFT, INNER and LEFT INNER are just the same joins:

Both joined tables must have at least one record for the join condition.

LEFT OUTER or OUTER joins will fetch data if at least one of the two joined tables have a record for the join condition.

More suggestions welcome!

regards,

Clemens Li