How to retrieve duplicate rows in a table?
How to delete the duplicate entries in a table?
Answer Posted / anil kumar karasi
1.
Select from <table name A>
where rowid > (select min(rowid) from <table name B>
where A.keyvalues=B.keyvalues);
2.
Delete from <table name A>
where rowid > (select min(rowid) from <table name B>
where A.keyvalues=B.keyvalues);
Is This Answer Correct ? | 12 Yes | 9 No |
Post New Answer View All Answers
Can we write ddl in trigger?
How are the exceptions handled in sql server programming?
How does using a separate hard drive for several database objects improves performance right away?
Explain what is dbcc?
Define constraints and give an example of their use?
What is the purpose of update statistics and scope_identity() function?
What is a unique key constraint?
What is indexing in sql server with example?
Thanks to some maintenance being done, the sql server on a failover cluster needs to be brought down. How do you bring the sql server down?
What is the use of sign function?
How to provide values to user defined function parameters?
Write a SQL query in order to merge two different columns into single column?
How to store and query spatial data?
What is cursor in ms sql server?
How do I shrink an ldf file?