Please help me with this query..
I have two tables..One is customer details table and another transaction details table.
The customer details table has all the details of internal customers..
like following
Cust_id Accnt_id
1 001
2 002
and so on..
The transaction details table has details like
TxnId Acnt_id Type benAcnt DrAcntId
12 001 dep 001 235
13 001 dep 001 002
14 001 with 456 001
15 001 with 003 845
And so on..
What i want is the list of all account ids that 001 has transacted with irrespective of type..Here 001,002,003 are internal customers while 235,456,845 are external customers whose details are not available in customer details table..So i want the list of such external customers transacted with customer 001. Some thing like following,
Acnt_id ExternalAcnt_id
001 235
001 456
001 845 . Please help in forming query for this..
I have two tables..One is customer details table and another transaction details table.
The customer details table has all the details of internal customers..
like following
Cust_id Accnt_id
1 001
2 002
and so on..
The transaction details table has details like
TxnId Acnt_id Type benAcnt DrAcntId
12 001 dep 001 235
13 001 dep 001 002
14 001 with 456 001
15 001 with 003 845
And so on..
What i want is the list of all account ids that 001 has transacted with irrespective of type..Here 001,002,003 are internal customers while 235,456,845 are external customers whose details are not available in customer details table..So i want the list of such external customers transacted with customer 001. Some thing like following,
Acnt_id ExternalAcnt_id
001 235
001 456
001 845 . Please help in forming query for this..
Comment