Database View - One to Many relationship
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-27-2023 07:50 PM
Hi,
I'm trying to create a database view that has a one-to-many relationship.
I have to implement this requirement because of a plugin's limitation that I will use.
These are tables I would like to join.
・Table A(Referenced by Table B, has multiple records of TableB)
・Table B (References Table A)
Column b1(Reference field to Table A)
I would like to show these tables as below picture. (One Table A record has multiple Table B records as a related list.)
I created a database view as below.
Table A : Prefix a
Table B : Prefix b
Where clause : b_u_column_b1=a_sys_id
But it didn't work as I expected. It seems that the database view has one-to-one relationship.
Does anyone know how to create a database view that has one-to-many relationship?
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-27-2023 10:14 PM
Hi @k_yamamoto ,
It was showing A0001001 record 3 times with different table B records. Try to group by number field of table A then you will see the difference.
Thanks,
Gopi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-27-2023 10:42 PM
Hi,@Gopi Naik1
Thank you for your reply.
Do you mean setting group by on a list view?
I would like to see that Table A record has a 3 Table B records on a form as the picture I posted first.(Like a Related Lists)
If you know any way to make it, it helps.
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-27-2023 11:00 PM
Hi @k_yamamoto ,
Do you want report to show how many B table record add to A table records or you need a related list on A table to show the B table records?
Thanks,
Gopi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-27-2023 11:19 PM
Hi, @Gopi Naik1
I need a related list on the A table form to show the B table records.
And also, the plugin I will use requires that relationship between A table and B table be created by Database View.
(This plugin will be used to output table data with PDF format.)