当前位置:网站首页>Join in ABAP CDs

Join in ABAP CDs

2022-06-24 16:16:00 a handsome young man.

CDS Supported by join Yes :

  • Inner Join

define view ztest_cds3 as select from sflight as _sf

inner join spfli as _spf

on _sf.carrid = _spf.carrid

and _sf.connid = _spf.connid{

_sf.carrid,

_sf.connid,

_sf.fldate,

_sf.price,

_spf.countryf

}

Inner Join The returned result is table sflight And spfli The intersection between

  • Left outer join

define view ztest_cds3 as select from sflight as _sf

left outer join spfli as _spf

on _sf.carrid = _spf.carrid

and _sf.connid = _spf.connid{

_sf.carrid,

_sf.connid,

_sf.fldate,

_sf.price,

_spf.countryf

}

LEFT OUTER JOIN Return to left table sflight All rows and right table spfli Satisfy ON The conditions are right , If the left watch sflight The row of is in the right table spfli There is no match in , Then the right table of this row spfli The corresponding data in is NULL Instead of .

LEFT OUTER JOIN Generate left table sflight Complete works , The right table spfli The match in the has a value , If there's no match, take null Value substitution .

  • Right outer join

define view ztest_cds3 as select from sflight as _sf

right outer join spfli as _spf

on _sf.carrid = _spf.carrid

and _sf.connid = _spf.connid{

_sf.carrid,

_sf.connid,

_sf.fldate,

_sf.price,

_spf.countryf

}

RIGHT OUTER JOIN Return to the right table spfli All rows and left table sflight Satisfy ON The conditions are right , If the right table spfli The row of is in the left table sflight There is no match in , So this business The left table sflight The corresponding data in is NULL Instead of .

RIGHT Outer JOIN Generate right table spfli Complete works , And the left table sflight The match in the has a value , If there's no match, take null Value substitution .

  • Cross join

define view ztest_cds3 as select from sflight

cross join spfli{

sflight.carrid,

spfli.connid

}where sflight.carrid = 'AA'

cross join Returns the Cartesian product of two tables . If not where Conditions , The resulting data will be very large .

原网站

版权声明
本文为[a handsome young man.]所创,转载请带上原文链接,感谢
https://yzsam.com/2021/04/20210430190559129u.html

随机推荐