self referencing table many to many relationship
476330Dec 19 2005 — edited Dec 19 2005I am in a bit of a logic pickle, and I was wondering if someone could help me out.
I have a table in a database I am designing called document, it holds information on surprisingly on documents in our DMS.
I want to create the notion that a document can have multiple related documents, and those documents can be the related documents for many documents.
So it is a self referencing table, I have done these before so no big deal, but this time is a many to many relation, it wasnt before.
Maybe something like:
document
docid (pk)
related_doc
docid (pk) (fk to document.docid)
related_docid (pk) fk to document.docid)
Does anyone have any experience with this or any advise I might find sueful?
Thanks!