2020 Feb 04 6:55 PM
While creating a CDS view , be it left outer join or right or right outer join, what is the rule of thumb to decide which table should be considered to be right and which table should be considered to be right and which table should be considered to be left ?
2020 Feb 04 9:48 PM
I guess your question is: "what is left outer join?" (with the answer you will deduce easily what is right outer join).
This question is very frequent on internet.
Anyway, I found this blog post useful to understand what is an inner join and what is the left outer join: https://blogs.sap.com/2015/04/07/join-types-sap-queries/
2020 Feb 04 9:48 PM
I guess your question is: "what is left outer join?" (with the answer you will deduce easily what is right outer join).
This question is very frequent on internet.
Anyway, I found this blog post useful to understand what is an inner join and what is the left outer join: https://blogs.sap.com/2015/04/07/join-types-sap-queries/
2020 Feb 04 10:20 PM
select * from TABLE1 join on TABLE2..
Sooooo you tell me which one is on the right of the join and which is on the left....THAT is your answer. 😃
2020 Feb 05 2:49 AM
I think the rule of thumbs is, Primary source placed on the Left, while Secondary source placed on the right.
2020 Feb 05 4:30 AM
bodhisattwa.pal2,
In addition to the points mentioned by Sandra Rossi,
To understand which table to be placed at left or right you first need to have a deep knowledge of all the Joins. From here It all depends on the fields you are intended to fetch from the tables.
Mainly your business scenario will matter to make the decision on the same. I would recommend you to do the following exercise.
Select any Two tables, write different select queries applying all types of Joins also by toggling the tables at left/right. See the different results you received, now try to frame a business scenario when would business need such a result.
Above exercise is only for practice, the more you practice the better you will get to know the concepts.
All the Best!!! Cheers!
Regards!
2020 Feb 05 5:39 AM
Hi Bodhisattwa,
Decide your base table as per your requirement , and it will be your left table in any join.
Best regards,
Sagarkumar Darji