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 are the differences between UNION and JOINS?

3 Answers   CarrizalSoft Technologies,


What are the advantages of the mirroring?

0 Answers  


What is Data model and how to prepare a data model.?

1 Answers   TCS,


how many bits ip address consist of? : Sql server database administration

0 Answers  


Does dbcc checkdb requires db to be in single_user mode? : sql server database administration

0 Answers  






How do I know if localdb is running?

0 Answers  


What is the order in which the SQL query is executed? list them in order.

5 Answers   CarrizalSoft Technologies, CTS, Oracle,


can any one post me, how to remove rows in the below table ENO ENAME EDEPT ELOC 3368 BPS BI Adayar 3371 RAN BI valachari 3369 SRI BI valachari 3372 jay BI Chn - - - - - - - -

2 Answers  


What is the difference between a stored procedure and a user defined function?

0 Answers  


How can sql server instances be hidden? : sql server security

0 Answers  


What are the disadvantages of using the stored procedures?

0 Answers  


What is the Disadvantage of indexed sequential file.

0 Answers   HCL,


Categories