|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
Reflexive Relation.
Hi, I would like advice on how to most efficiently design a reflexive relation.
I have 2 use cases for that: 1) table A have a 1-n relation with itself. For example I want to modelise A1 as an row and to notify that A1 is compatible with A2 / A3 and A4. But this also implies that A2 is compatible with A1 (but it doesn't imply that A2 and A" are compatible). So the relation A1-A2 is identical to the relation A2-A1. The main query used on this would be to answer the 2 questions "What is An compatible with? " "Is An compatible with Am ?". I would like to avoid having to play my queries both way and checking if the *reversed* relation exists as well in the database before inserting it... 2) table Segment define a connection between two points. A segment is not oriented and is defined by 2 extremities. In the following example, Segment 1 and Segment 2 are somehow identical and violating the uniqness... Segment 1 ---------- Extremity_1 = A Extremity_2 = B Segment 2 ---------- Extremity_1 = B Extremity_2 = A I would like to implement this the best way to abstract this complexity from all queries. Thanks for your help =)
__________________
"The ultimate knowledge is reached when it does not bring new questions..." -- Usaphdas encyclopedia XV.4 |
![]() |
| Viewing: Dev Shed Forums > Databases > Oracle Development > Reflexive Relation. |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|