on 06-06-2022 1:56 PM
Table PAPERVERSIONS
Table PAPERAUTHORS
I was trying to get the display the Paper Author but not familiar with SELECT JOIN on ABAP
Expected output is to dispaly Schmee Maluche
Here's my code:
SELECT SINGLE paperversions~paper_id, paperauthors~paper_id<br>
FROM paperversion<br>
INNER JOIN paperauthors<br>
ON paperversions~paper_id = paperauthors~paper_id<br>
INTO @l_test<br>
WHERE paper_author EQ @ "MY CUSTOM FIELD XXX"
Hi,
Please try below code. Below query will display paper id and corresponding paper author. if you just want to print paper author then write only paper_author in select single.
SELECT SINGLE paperversions~paper_id, paperauthors~paper_author
FROM paperversions
INNER JOIN paperauthors
ON paperversions~paper_id = paperauthors~paper_id
INTO @l_test
WHERE paper_author EQ @ "MY CUSTOM FIELD XXX"
Regards,
Anuja Kawadiwale
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
If you want to print only paper_autor which is present in paperauthors table then you don't need to join both tables.
You can directly fetch paper_author from paperauthors table.
SELECT SINGLE paper_author
FROM paperauthors
INTO @l_test
WHERE paper_author EQ @ "MY CUSTOM FIELD XXX"
Hi
If you use INNER JOIN - then both the tables should have that ID (you passed in where clause) - else no rows will be displayed
If you use LEFT OUTER JOIN - then the table on left side you used, it will display all rows that matches the id that you pass in where clause ( even if auther table does not contain that id)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
88 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.