AnsweredAssumed Answered

How to set up a many-to-many self-join relationship

Question asked by navarro on Aug 31, 2017
Latest reply on Aug 31, 2017 by navarro



I am setting up a food data base that lists not only the foods but also the foods incompatible between each other.


So, food 1 can have a number of incompatible foods, for example: food 5, food 9, food 15, & food 20


The setting that comes up to my mind is a self join relationship using the Food table, but I am not quite sure how to set it up.



  • Food
  • Incompatibility




Food Table

__kpFood ID



Incompatibility Table






Table Occurrences (TOs)


Food TO based on the Food table

Incompatibility TO based on the Incompatibility table

FoodIncompatible TO based on the Food table






Food TO--< Incompatibilityb TO>--FoodIncompatible TO


__kpFoodID = _kfFood


                        _KfFoodIncompatible = __KpFoodID




My purpose is to have a portal to Incompatibility TO in a layout based on Food TO and through scripting add the incompatible foods to the current food record.


My question is whether my set up is correct or not.