How can delete duplicate records in cte in sql server?
Answer / Shyam Lal Kushwaha
To delete duplicate records from a CTE (Common Table Expression) in SQL Server, you can use the ROW_NUMBER() window function along with DELETE statement. Here is an example:nnWITH cte AS (n SELECT *, ROW_NUMBER() OVER(ORDER BY YourColumn) as rnn FROM YourTablen)nDELETE cte WHERE rn > 1;
| Is This Answer Correct ? | 0 Yes | 0 No |
Explain primary key, foreign key and unique key?
I create a separate index on each column of a table. What are the advantages and disadvantages of this approach? : Sql server database administration
what are the new features of sql server 2005?
8 Answers HP, Keane India Ltd,
optimization techinques
Which command is used for user defined error messages?
What are the types of dml?
What is join query?
what are file groups?
Why functions are used in sql server?
What is raid and what are different types of raid levels?
Where the sql logs gets stored?
What is transaction server auto commit?
Oracle (3253)
SQL Server (4518)
MS Access (429)
MySQL (1402)
Postgre (483)
Sybase (267)
DB Architecture (141)
DB Administration (291)
DB Development (113)
SQL PLSQL (3330)
MongoDB (502)
IBM Informix (50)
Neo4j (82)
InfluxDB (0)
Apache CouchDB (44)
Firebird (5)
Database Management (1411)
Databases AllOther (288)