I have two tables from unrelated systems. The only common field for the tables is an amount field. I would like to return a result set of which amounts match, without repeating any match. For example:
Table A Table B
ID Amount ID Amount
---------------- ------------------
1 50.00 1 25.00
2 25.00 2 25.00
3 50.00 3 50.00
4 75.00 4 100.00
5 150.00 5 75.00
Desired Return Set:
A.ID A.Amount B.ID B.Amount
--------------------------------
1 50.00 3 50.00
2 25.00 1 25.00
4 75.00 5 75.00
I can't think of a clean way to do this with SQL. It would be nice if I could. So is this possible, or am I going to have to write a program for this?
Thanks for your help.
Table A Table B
ID Amount ID Amount
---------------- ------------------
1 50.00 1 25.00
2 25.00 2 25.00
3 50.00 3 50.00
4 75.00 4 100.00
5 150.00 5 75.00
Desired Return Set:
A.ID A.Amount B.ID B.Amount
--------------------------------
1 50.00 3 50.00
2 25.00 1 25.00
4 75.00 5 75.00
I can't think of a clean way to do this with SQL. It would be nice if I could. So is this possible, or am I going to have to write a program for this?
Thanks for your help.