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 is cursors? And what are the different types of cursor?

0 Answers  


What is resource governor?

0 Answers  


What is tempdb in sql server?

0 Answers  


Why I am getting this error when renaming a database in ms sql server?

0 Answers  


Can we have more than one NULL in a column having unique constraint?

12 Answers   247Customer,






hw you create table in sql using existing table and variable should be in specific order given ex : in old table empid empname empsal empage empbirthdate empaddrs like is there in new table we need it as EX: exmpname empage empaddrs empid empbirthdate like we want hw we create this as a table not view or nt reporting

2 Answers  


How to replace null values in expressions using isnull()?

0 Answers  


What are temporal tables in sql server 2016?

0 Answers  


What does truncate do?

0 Answers  


What is the minimum recommended amount of ram for sql server 2012 enterprise?

0 Answers  


Is mysql better than sql server?

0 Answers  


What are the tool windows in sql server management studio? : sql server management studio

0 Answers  


Categories