adspace
Write a sql query to delete duplicate records from a table called table1
Answer Posted / Vipin Sonkar
You can delete duplicate rows from a table in SQL Server using the ROW_NUMBER() window function:
```sql
WITH cte AS (
SELECT *,
ROW_NUMBER() OVER(ORDER BY YourColumn) as rownum
FROM Table1
)
DELETE FROM cte WHERE rownum > 1
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
Can we do dml on views?
How to remove duplicate rows from table except one?
Can you index views?
Why use identity in sql server?
How do I create a trace in sql server?
Equi join and non equi join is possible with sql server?
Where can you add custom error messages to sql server?
what is spatial nonclustered index
Does view occupy space?
How raid can influence database performance?
What are the source of constraints?
How to rebuild the master database?
what is the Ticketing tool used in Wipro technologies at Bangalore...???
What is temporary table in sql server? Why we use temp table?
How efficient you are in oracle and SQL server?