Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

self referencing table many to many relationship

476330Dec 19 2005 — edited Dec 19 2005
I 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!
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 16 2006
Added on Dec 19 2005
3 comments
1,063 views