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
you want to be sure that queries in a database always execute at the maximum possible speed. To achieve this goal you have created various indexes on tables which other statement will keep the database in good condition? : Sql server administration
What is sql server programming?
What are cascading parameters in ssrs reports?
Explain logical operators in sql server?
What is data source document?
what are questions asked in TCS for database tester (sqlserver)for 2-3 exp?
What are the difference between primary key and unique key? : sql server database administration
Is INSTEAD OF trigger directly applicable to Table ?
What is a transact-sql statement?
what are the different ways to return the rowcount of a table?
What are the differences between char and varchar in ms sql server?
How to insert a new row into a table with "insert into" statements in ms sql server?
You want to use bids to deploy a report to a different server than the one you chose in the report wizard. How can you change the server url?
Can select statements be used on views in ms sql server?
How to create an identity column?