How to delete the duplicate rows from a table in SQL Server ??
Answer Posted / vnreddy
create table sampletbl(id int,name varchar(100))
insert into sampletbl values(1,'aa')
insert into sampletbl values(1,'aa')
insert into sampletbl values(1,'aa')
insert into sampletbl values(2,'bb')
insert into sampletbl values(2,'bb')
with cte as(
select ROW_NUMBER() over (partition by id order by id) as r_no,* from sampletbl)
delete from cte where r_no>1
select * from sampletbl
| Is This Answer Correct ? | 10 Yes | 2 No |
Post New Answer View All Answers
What is the downside of using udf?
You are creating an application where users are asked their gender in the gender combo box you have three options: ‘male’ , ‘female’ and ‘i choose not to disclose’ these options are stored in the table as 1, 0 or null which datatype should you use?
What is checkpoint in sql server?
Explain something about security and SQL Azure?
What are unicode character string data types in ms sql server?
Mention the different types of replication in sql server.
What are .mdf files?
What is a db view?
What is difference between equi join and natural join?
What are click through reports?
What are distinctive joins find as a part of sql?
 Explain what is sql override for a source taLle in a mapping?
Explain DBCC?
What area unit the various kinds of info compression introduced in sql server 2008?
What are drillthrough reports?