Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
kond.mohan
Posting Yak Master
213 Posts |
Posted - 2013-03-02 : 05:43:04
|
hi,i have table in sql sever 2008(having count is 15668050),my table pkey is ACID+ACCT_POA_AS_SRL_NUM+BANK_IDusing this key i want to know the duplicate valuse in the tablei have tried few queries. but i didn't get the solution.----SELECT ACID+ACCT_POA_AS_SRL_NUM+BANK_ID, COUNT(*) TotalCountFROM abc GROUP BY ACID+ACCT_POA_AS_SRL_NUM+BANK_IDHAVING COUNT(*) > 1ORDER BY COUNT(*) DESC---------- |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2013-03-02 : 06:25:13
|
[code]SELECT ACID,ACCT_POA_AS_SRL_NUM,BANK_ID, COUNT(*) TotalCountFROM abc GROUP BY ACID,ACCT_POA_AS_SRL_NUM,BANK_IDHAVING COUNT(*) > 1ORDER BY COUNT(*) DESC[/code]if you've pk set via constraint, it will never have duplicate values------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
|
|
|
|
|