please suggest a sql statement [message #314172] |
Tue, 15 April 2008 23:04 |
avrillavinge
Messages: 98 Registered: July 2007
|
Member |
|
|
Kindly Suggest a sql statement
Hi,
I have a table Account in which Acc_Key is PK.
Acc_co_Num, Acc_Pro_code, Acc_id are composite primary keys.
For each unique combination of Acc_co_Num, Acc_Pro_code, Acc_id should have a unique Acc_Key.
I want to find all Acc_Key which have same combination of Acc_co_Num, Acc_Pro_code, Acc_id.
Please suggest a sql to find all the Acc-Key as in the snapshot.
i tried this :select a.Acc_key from
account a INNER JOIN account b on (A.Acc_co_num = B.Acc_co_num and a.acc_pro_code = b.acc_pro_code and a.acc_id = b. acc_id)
doesnt work pls help ..
|
|
|
|
|