How to count the number of duplicate items in a table?

Answers were Sorted based on User's Feedback



How to count the number of duplicate items in a table?..

Answer / mr.abdul rahim

select count(column), column from table group by column
having count(column) > 1

Is This Answer Correct ?    4 Yes 1 No

How to count the number of duplicate items in a table?..

Answer / pavan

Hi,
try this query.In this query sal one val is duplicated
4items


select sal,count(sal) from test group by sal having count
(*)>1

Is This Answer Correct ?    4 Yes 4 No

How to count the number of duplicate items in a table?..

Answer / lalit goyal

select count(*) from (select boss_ID,COUNT(boss_ID) as s from dbo.Employee group by boss_ID ) a where s>1

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More SQL Server Interview Questions

Explain foreign key in sql server?

1 Answers  


We create an index to fast the search. How it fast the query? Do we write any special keyword with query?

3 Answers  


Where do we use trace frag?

1 Answers  


Why I have to use stored procedures?

1 Answers   Cognizant,


What is the return type of executeupdate ()?

1 Answers  


How can I create a table from another table without copying any values from the old table?

3 Answers  


How do I edit a procedure in sql server?

1 Answers  


How to write the storeprocedure with in the store procedure? and how can we write the store procedure with in a trigger vice versa? plz post me the exact answer?

1 Answers   ABC,


What is the command to change the recovery model?

1 Answers  


What is split brain scenario in DB mirroring?

1 Answers  


What is the difference between stored procedure and user defined functions?

1 Answers  


How to test a dml trigger in ms sql server?

1 Answers  


Categories