Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

how to delete duplicate rows from table

Answer Posted / navaneethakrishnan

table name : tblduplicate

Ans : DELETE TOP(1) FROM [tblduplicate] WHERE [ID] = 1

Example :

CREATE TABLE tblduplicate(ID int NOT NULL, Name varchar(50))

insert into tblduplicate values(1, 'Name1')
insert into tblduplicate values(1, 'Name1')
insert into tblduplicate values(2, 'Name2')
insert into tblduplicate values(2, 'Name2')
insert into tblduplicate values(3, 'Name3')
insert into tblduplicate values(3, 'Name3')

select * from tblduplicate

Result :
1 Name1
1 Name1
2 Name2
2 Name2
3 Name3
3 Name3

DELETE TOP(1) FROM [tblduplicate] WHERE [ID] = 1

Is This Answer Correct ?    1 Yes 7 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why use “nolock” in sql server?

983


What is normalization 1nf 2nf 3nf?

1003


What are the reporting services components?

130


What is the purpose of object explorer and its features? : sql server management studio

1121


What are the differences between local and global temporary tables?

1013


Would you store your query in a ssrs report or a database server? State the reason why?

148


How to manipulate data from one table to another table ?

910


Mention the different types of replication in sql server.

957


What is the difference between a fill factor of 100 and 0?

920


What is a with(nolock)?

925


How will you find out if there are expensive SQL statements running or not?

966


How do you rename a table in sql server?

939


You are doing log shipping due to some reasons it is failing. How you will proceed from there

2017


Can you explain different types of locks in sql server?

911


If you are given access to a SQL Server, how do you find if the SQL Instance is a named instance or a default instance?

1040