Hi all...
I'm trying to model a somewhat unusual relationship. It is a "friend"
relationship where rows of a table are related to other rows of the
same table. It is a M:N relationship where the same table appears on
both sides; it is like a bill-of-materials type relationship (table
related to itself), except M:N instead of 1:N.
Can anyone think of a convenient way to model this? I'm trying to
avoid giving "preference" to one side of the relationship over
another. Here's a sample way to model it that has this problem:
Table: People
Name
----
Joe
Bill
Anne
Betty
Table: Friends {holds the is-a-friend-of relationship)
Friend1 Friend2
------- -------
Joe Bill
Joe Anne
Betty Joe
Note that to get a list of all of Joe's friends I need two queries -
one in case he is in the first column, one in case he is in the
second. Although the actual problem involves machine parts, this
sample problem is functionally identical.
Obviously, I'm trying to do this under a relational model - the actual
implementation will be used in MS Access, with the data probably
stored in DBF files of some flavor.
Thanks for any help anyone can provide.
-Kyle