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

How to change server name in sql server?

1172


What is isolation levels?

1018


How to generate create view script on an existing view?

976


What is the purpose of floor function?

1027


How is sql used in sql server?

997


Explain how to send email from sql database?

1041


How to grant a permission in ms sql server using "grant execute" statements?

1078


Explain isolation levels that sql server supports?

1027


How to create a view with data from multiple tables?

1005


Is it true, that there is no difference between a rule and a check constraint?

1029


What is the difference between a clustered index and a non-clustered index?

983


Why use sub query in sql server and list out types of sub queries?

988


you have a table with close to 100 million records recently, a huge amount of this data was updated now, various queries against this table have slowed down considerably what is the quickest option to remedy the situation? : Sql server administration

939


What causes index fragmentation?

986


what's the maximum size of a row? : Sql server database administration

1073