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

What does the on delete cascade option do?

0 Answers  


Which is better in performance - CONSTRAINT or TRIGGER over a column which restricts say an input of particular value in a column of a table?

3 Answers   Accenture,


How do I edit a stored procedure in sql server?

0 Answers  


what is raid and what are different types of raid configurations? : Sql server database administration

0 Answers  


What is it unwise to create wide clustered index keys?

0 Answers  






How to Execute an Operating System Command From Within SQL Server ?

3 Answers  


What are the types of indexes available with SQL Server?

2 Answers   Standard Bank,


What is the default Port No on which SQL Server listens?

0 Answers  


What is the purpose of using COLLATE in a query?

1 Answers  


Explain what is use of dbcc commands?

0 Answers  


Plz tell about backup&recovery?

3 Answers  


Define constraints and give an example of their use?

0 Answers  


Categories