| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> comp.databases.theory -> Re: More on lists and sets
Marshall Spight wrote:
> > > As join/intersection is noncommutative, we have left selection and right
> > selection.
>
> I don't see why it's not commutative.
Example:
1->2->1 /\ 2->1->2
A(x,y)
B(x,z)
Join the relations
A(x,y)&&B(y,z)
Order
A(x,y)&&B(y,z)
2 1 + 0*100 = 1 1 0 + 1*100 = 100 1 2 + 1*100 = 102 2 1 + 2*100 = 201
The result: 2->1->1->2
2->1->2 /\ 1->2->1
This have to be ordered differently
A(x,y)&&B(y,z)
1 0*100 + 1 = 1 2 1*100 + 0 = 100 2 1*100 + 2 = 102 1 2*100 + 1 = 201
The result: 1->2->2->1
I use the word "list join" instead of "my list intersection" from now on. List join performs two operations at once: selection and ordering -- this is why it's not very intuitive, at first.
The other example. Left join with natural numbers leaves list as it is. Right join sorts it in the ascending order. Again, I need couple more convincing examples. E.g. How to remove duplicates in this algebra? How to invert list? Received on Mon Mar 27 2006 - 12:34:37 CST
![]() |
![]() |