Write a query to delete duplicate records in SQL SERVER
Answer Posted / prasant ojha
create a table tbl_info
(
name varchar(250),
age int
)
Enter values
'RAM',25
'SHYAM',34
'RAM',25
'GHANSHYAM',25
'RAM',25
//SQL QUERY TO REMOVE DUPLICATE RECORDS WITHOUR ANY KEY
with info_tbl as(
SELECT *,row_number() over(partition by name order by name)
as record_no from tbl_info
)
delete from info_tbl where record_no>1
Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What are audit control procedures?
What is spid in sql server profiler?
When we should use and scope of @@identity?
Can coalesce return null?
Explain transaction server isolation?
How do triggers work?
What is an entity-relationship diagram (erd)?
What is the definition for sql server 2000?
what is a deadlock? : Sql server database administration
What should be the fill factor for indexes created on tables? : sql server database administration
what is denormalization and when would you go for it? : Sql server database administration
What is a transactions?
Explain in details security in SQL azure?
What causes index fragmentation?
Why olap is used?