Click here to Skip to main content
15,917,709 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am working on one database(ecommerce site). in that one table with duplicate records.I want your help to find duplicate records in a 50 column table on SQL Server.

There are '_id' column have primary key in table but i have to avoid it for find duplicate records .
Posted
Updated 16-May-13 19:23pm
v3
Comments
Aarti Meswania 17-May-13 1:19am    
Is there any primary key in table?
[no name] 17-May-13 1:22am    
yes there are '_id' column have P.K. in this table but i have to avoid it for find duplicate records .

1 solution

select col_name,count(col_name) from tbl_name group by col_name having count(col_name) > 1
 
Share this answer
 
Comments
[no name] 17-May-13 1:35am    
it give only one column duplicate data i have to find out from 49 row exclude p.k. column.
Sant Osha 17-May-13 3:17am    
49 rows or column ?
gvprabu 17-May-13 3:26am    
shall u give the 49 column sample value, then only we have decide. But we can't able to write sql query for find the duplicate records with the combinations of 49 columns.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900