I have a transaction network in DB2,which like below:
Table:trans
Originator Beneficiary Amount
A B 100.00
C D 150.00
B F 400.00
D Z 30.00
Let's say, we know A and C is the originator of transaction.
Now I select * from trans where Originator in (A,C)
Then I select * from trans where Originator in (select * from trans where Originator in (A,C)
Is there any method to tracing all counterpart in a single SQL? And is there better method to trace money?