# Master Detail Relation only one per table

**URL:** <https://forum.radsystems.io/t/master-detail-relation-only-one-per-table/1120>\
**Category:** PHPRad Classic\
**Created:** [October 7, 2022, 6:45am UTC](https://forum.radsystems.io/t/master-detail-relation-only-one-per-table/1120 "2022-10-07T06:45:06Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![NotBrian](https://forum.radsystems.io/letter_avatar_proxy/v4/letter/n/87869e/32.png) [@NotBrian](https://forum.radsystems.io/u/NotBrian)\
**Post date:** [October 7, 2022, 6:45am UTC](https://forum.radsystems.io/t/master-detail-relation-only-one-per-table/1120/1 "2022-10-07T06:45:06Z")

</div>

I have found that you can only use one master detail per table.  
I have a table: tblArt with several id related to other tables: idArtist, idSeller, idBuyer.  
But when I use the second Master Detail Relation it gives an error, mentioning the NOT Unique tableName.  
I have solved it by creating 3 views:  
CREATE OR REPLACE VIEW viewArtist AS  
SELECT \*  
FROM tblPerson

But it would be nice to have an update where the second table has an Alias, so that we can use the Master Detail on more columns.  
Thanks in advance.  
Brian

---

<div class="post-metadata">

**Author:** ![willvin](https://forum.radsystems.io/user_avatar/forum.radsystems.io/willvin/32/7_2.png) [@willvin](https://forum.radsystems.io/u/willvin)\
**Post date:** [October 7, 2022, 9:06pm UTC](https://forum.radsystems.io/t/master-detail-relation-only-one-per-table/1120/2 "2022-10-07T21:06:07Z")

</div>

Can you provide screenshots to clarify what you mean, so that i can confirm from my end and report the issue.

---

<div class="post-metadata">

**Author:** ![NotBrian](https://forum.radsystems.io/letter_avatar_proxy/v4/letter/n/87869e/32.png) [@NotBrian](https://forum.radsystems.io/u/NotBrian)\
**Post date:** [October 10, 2022, 7:16am UTC](https://forum.radsystems.io/t/master-detail-relation-only-one-per-table/1120/3 "2022-10-10T07:16:28Z")

</div>

![2022-10-09_14-31](https://forum.radsystems.io/uploads/default/original/1X/a47beef643dd435a69c3d3623498a28223000de9.png)  
I have a table aba\_tblKunst, with three columns related to an other table: aba\_tblpersonen.  
idKunstenaar, idVerkoper and idKlant.

But after building I get this an error.

I think the error is in the part of the program which generate this code:

I have solved it for now with the creation of three views, this works, as the table/view names are unique.

With kind regards,  
Brian

---

<div class="post-metadata">

**Author:** ![NotBrian](https://forum.radsystems.io/letter_avatar_proxy/v4/letter/n/87869e/32.png) [@NotBrian](https://forum.radsystems.io/u/NotBrian)\
**Post date:** [October 10, 2022, 7:17am UTC](https://forum.radsystems.io/t/master-detail-relation-only-one-per-table/1120/4 "2022-10-10T07:17:19Z")

</div>

As I can only upload one image at a time, here is the other image.

 ![2022-10-09_14-32](https://forum.radsystems.io/uploads/default/original/1X/5b79d9c5906d6c38bbf721a8dbc46905dbd8beef.png)

---

<div class="post-metadata">

**Author:** ![NotBrian](https://forum.radsystems.io/letter_avatar_proxy/v4/letter/n/87869e/32.png) [@NotBrian](https://forum.radsystems.io/u/NotBrian)\
**Post date:** [October 10, 2022, 7:18am UTC](https://forum.radsystems.io/t/master-detail-relation-only-one-per-table/1120/5 "2022-10-10T07:18:10Z")

</div>

And the error: (after a few seconds…)

 ![2022-10-09_14-33](https://forum.radsystems.io/uploads/default/original/1X/a9a28185c1d58c56bbc1d617c0f2098d599ed69d.png)

---

<div class="post-metadata">

**Author:** ![NotBrian](https://forum.radsystems.io/letter_avatar_proxy/v4/letter/n/87869e/32.png) [@NotBrian](https://forum.radsystems.io/u/NotBrian)\
**Post date:** [October 10, 2022, 7:18am UTC](https://forum.radsystems.io/t/master-detail-relation-only-one-per-table/1120/6 "2022-10-10T07:18:54Z")

</div>

And the location where it might go wrong:

 ![2022-10-09_14-38](https://forum.radsystems.io/uploads/default/original/1X/f8b75de0602255076f1518db023ea341bdabc096.png)

---

<div class="post-metadata">

**Author:** ![NotBrian](https://forum.radsystems.io/letter_avatar_proxy/v4/letter/n/87869e/32.png) [@NotBrian](https://forum.radsystems.io/u/NotBrian)\
**Post date:** [October 10, 2022, 7:19am UTC](https://forum.radsystems.io/t/master-detail-relation-only-one-per-table/1120/7 "2022-10-10T07:19:42Z")

</div>

And the location of the file:

 ![2022-10-09_14-38_1](https://forum.radsystems.io/uploads/default/original/1X/feef8eeffc0eaa25d30aba510018dbfe4a3802f6.png)

---

<div class="post-metadata">

**Author:** ![willvin](https://forum.radsystems.io/user_avatar/forum.radsystems.io/willvin/32/7_2.png) [@willvin](https://forum.radsystems.io/u/willvin)\
**Post date:** [October 10, 2022, 7:46pm UTC](https://forum.radsystems.io/t/master-detail-relation-only-one-per-table/1120/8 "2022-10-10T19:46:21Z")

</div>

Okay, i understand properly now.
