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 |
Explain foreign key in sql server?
We create an index to fast the search. How it fast the query? Do we write any special keyword with query?
Where do we use trace frag?
Why I have to use stored procedures?
What is the return type of executeupdate ()?
How can I create a table from another table without copying any values from the old table?
How do I edit a procedure in sql server?
How to write the storeprocedure with in the store procedure? and how can we write the store procedure with in a trigger vice versa? plz post me the exact answer?
What is the command to change the recovery model?
What is split brain scenario in DB mirroring?
What is the difference between stored procedure and user defined functions?
How to test a dml trigger in ms sql server?
Oracle (3253)
SQL Server (4518)
MS Access (429)
MySQL (1402)
Postgre (483)
Sybase (267)
DB Architecture (141)
DB Administration (291)
DB Development (113)
SQL PLSQL (3330)
MongoDB (502)
IBM Informix (50)
Neo4j (82)
InfluxDB (0)
Apache CouchDB (44)
Firebird (5)
Database Management (1411)
Databases AllOther (288)