I have the following tables
TABLE 1
--------
letter date value
------ ---- -----
A d1 1
A d1 4
A d2 3
B d1 3
B d1 5
B d2 4
B d2 5
B d3 5
TABLE 2
-------
friend1 friend2
------- -------
A B
B C
The result I want returns the matching pairs (where date = date) for each group of friends. (hard to explain)
The result for the above example should be
friend1 friend2 date value1 value2
------- ------- ---- ------ ------
A B d1 1 3 (or 5)
A B d1 4 5 (or 3-not same as above)
A B d2 3 4 (or 5)
Does that make sense?? I want a 1-1 relationship. (id there's only one value for A on a certain date I only what one value for B on that same date - even if they are more )
Thanks
TABLE 1
--------
letter date value
------ ---- -----
A d1 1
A d1 4
A d2 3
B d1 3
B d1 5
B d2 4
B d2 5
B d3 5
TABLE 2
-------
friend1 friend2
------- -------
A B
B C
The result I want returns the matching pairs (where date = date) for each group of friends. (hard to explain)
The result for the above example should be
friend1 friend2 date value1 value2
------- ------- ---- ------ ------
A B d1 1 3 (or 5)
A B d1 4 5 (or 3-not same as above)
A B d2 3 4 (or 5)
Does that make sense?? I want a 1-1 relationship. (id there's only one value for A on a certain date I only what one value for B on that same date - even if they are more )
Thanks