How to count the number of duplicate items in a table?
Answers were Sorted based on User's Feedback
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 |
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 |
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 |
What is cursors? And what are the different types of cursor?
What is resource governor?
What is tempdb in sql server?
Why I am getting this error when renaming a database in ms sql server?
Can we have more than one NULL in a column having unique constraint?
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
How to replace null values in expressions using isnull()?
What are temporal tables in sql server 2016?
What does truncate do?
What is the minimum recommended amount of ram for sql server 2012 enterprise?
Is mysql better than sql server?
What are the tool windows in sql server management studio? : sql server management studio