Hi SAP,
we are upgrading from a Secondary HANA to a Primary and notice a different behaviour in JOIN in SQL.
When we use this SQL we get different results in both situations (I only had to change the "." into "~" to make it syntactically correct:
select
ESTRH.RECNROOT , ESTRH.SUBID , ESTVA.RECNTVH , ESTVA.ORD , ESTVH.ESTCAT , TCG12.ESTNAM , REL.RECNROOT_DST , REL.RECNROOT_SRC
from estrh
left outer join tcgtplrel as rel
on ( rel.recnroot_dst = estrh.recnroot and rel.delflg = ' ' )
join estvh as estvh on ( estvh.recnroot = estrh.recnroot or estvh.recnroot = rel.recnroot_src ) and estvh.delflg = ''
join estva as estva on estva.recntvh = estvh.recn and estva.delflg = ''
join tcg12 as tcg12 on tcg12.estcat = estvh.estcat and langu = 'N'
where estrh.subid = 'KUL_00001492'
and estvh.estcat = 'SAP_EHS_1019_003'
and estrh.delflg = ''
order by TCG12.ESTNAM
Formerly on the secondary database (native SQL) and now using Open SQL in ABAP we get 4 records as a result.
When submitting it as native SQL in HANA as primary we get 8 records as a result. This is due to doubles in the 'red' table ESTVA. These doubles also exist in the secondary database that still resides on our production system.
It seems as if in the first case, some GROUPING is done. The JOINs are exactly the same in both cases.
Is SQL behaving differently in different situations?
Anyone any idea?
Regards,
Kris