How to delete duplicate rows from table except one?
Answer / Ajay Kumar Sharma
"To delete duplicate rows from a table while keeping only one, you can use the ROW_NUMBER() window function. Here's an example:nnWITH CTE AS (n SELECT *, ROW_NUMBER() OVER(PARTITION BY column1, column2 ORDER BY column3) rnn FROM yourTablen)nDELETE CTE WHERE rn > 1".
| Is This Answer Correct ? | 0 Yes | 0 No |
Define full outer join?
Write a program using SQL queries to find a unique entry in a table.
how to overcome kernel isssues
What is the usage of the sign function?
What is an execution plan? How would you view the execution plan?
Define synonym?
What are the differences between lost updates and uncommitted dependencies?
What does the on update no action do?
Where do we generally create INDEX?
1 Answers Ernst Young, Thomson Reuters,
Explain filtered indexes?
Can a stored procedure call itself or recursive stored procedure? How many levels sp nesting is possible?
List out different types of normalizations in sql server and explain each of them?
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)