Delete duplicate records from the table?(Table must have
unique id)
Answer Posted / krishna
select *
from mytable b
join
(
select Duplicatecolumn,MAX(id) id
from mytable
group by Duplicatecolumn
) b1 on b.Duplicatecolumn = b1.Duplicatecolumn
where b.id <> b1.id
| Is This Answer Correct ? | 0 Yes | 1 No |
Post New Answer View All Answers
What is hierarchy, what are its types and difference between them? : sql server analysis services, ssas
Explain the difference between primary keys and foreign keys?
Explain full-text query in sql server?
When do you think a developer should use sql server-based cursors?
How is SQL Azure different than SQL server?
If no size is defined while creating the database, what size will the database have?
What are different types of constraints?
What does dml stand for?
Difference between uniqe index and uniqe constraint?
How to change the ownership of a schema in ms sql server?
Suppose i have a table that contains 5 columns like col1,col2...colm5.I want to import only two column through BCP utility.How to do same through BCP in sybase.
Difference Between ORDER BY Clause and GROUP BY Clause in SQL?
What does nvl stand for?
What is the difference between varchar and varchar types?
What is db stored procedure?