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 can be used instead of trigger?

0 Answers   ADITI,


1.What is the deferece between DBMS & RDBMS? 2.How can you trouble shoot? If u will get error while installing sql server? 3.How can u trouble shoot slow running query? 4.how can u trouble log shipping errors? 5.why do we use merge replication instead of T.log replication?

7 Answers   Microsoft,


what does the automatic recovery do? : Sql server administration

0 Answers  


How to define the name and server for a new dsn?

0 Answers  


Can we call future method from trigger?

0 Answers  


How will you collect the date from current date to last older 6 days date in sql server 2005

4 Answers  


How to transfer an existing table from one schema to another schema in ms sql server?

0 Answers  


What are explicit and implicit transactions?

4 Answers   BirlaSoft,


What meant by Performance Tuning,how can we do the performance tuning on stored procedures and tell some steps to do the performance tuning

3 Answers   TCS,


Explain Active/Active and Active/Passive cluster configurations

2 Answers  


Can two different columns be merged into single column? Show practically?

0 Answers   QuestPond,


What is normalization? Explain different forms of normalization?

0 Answers  


Categories