in tabase table having a column in it empname field is
there which having 5 duplicate values is there i want
deleted all the duplicates i want showing only one name
only.
Answer Posted / dinesh gupta
Kumar your query do not solve the purpose accurately.
It should be as
Delete from employee where empid
not in (Select min(empid) from employee group by empname
having count(empname)>=1)
| Is This Answer Correct ? | 1 Yes | 1 No |
Post New Answer View All Answers
What is a partition key?
How to get a list of columns in a view using the "sp_help" stored procedure?
Can we insert data if clustered index is disabled?
What is key attribute?
What is the purpose of floor function?
Differentiate between truncate vs delete in mssql?
can we have a nested transaction? : Sql server database administration
What are the different types of replication you can set up in sql server?
What are the components of sql server service broker?
Define cursor locking
Is foreign key a primary key?
While using a cursor, how can you differentiate between a deleted row and a row that has been inserted with null data values?
Can the “if update (colname)” statement be used in a delete trigger?
What is replication and database mirroring?
How to run sql server 2005 books online on your local system?