Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

What Do You Call This Relationship ? Expand / Collapse
Author
Message
Posted Wednesday, February 20, 2013 11:49 AM


SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Wednesday, September 10, 2014 1:06 PM
Points: 2,829, Visits: 8,479
I have a situation with items that are related, but not really in a heirarchy ... more like parent to parent. As shown below, all the ODD numbers are related to each other equally so that '1' is related to '11' via the other entries. ie, 5 is related to 1, and 11 is related to 5, therefore 11 is related to 1.

And all the EVEN numbers are related to each other equally, so that '12' is related to '2' because 12 is related to 10, 10 is related to 8, and 8 is related to 2.

I need to consolidate related rows into 1 summary row (selecting oldest & newest dates), and looking for examples on the InterWebz, but not sure what keywords I should be looking for to describe this kind of relationship.


Item_A	Item_B
5 1
6 4
7 3
8 2
9 7
10 6
10 8
11 5
11 9
12 10




Post #1422233
Posted Thursday, May 16, 2013 3:37 PM


Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: Wednesday, August 27, 2014 3:05 PM
Points: 355, Visits: 870
With the ODD numbers, how is 7,5,3 related. Did you miss 7 is related to five?
thanks
Post #1453800
Posted Friday, May 17, 2013 3:20 AM
SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Today @ 5:50 AM
Points: 2,856, Visits: 5,124
It's a tree or hierarchy, whatever you prefer.
I guess, you will need to use some sort of recursive CTE. Hard to say anything more based on provided limited details.


_____________________________________________
"The only true wisdom is in knowing you know nothing"
"O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!"
(So many miracle inventions provided by MS to us...)

How to post your question to get the best and quick help
Post #1453900
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse