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

Is natural join and equi join same?

1030


How important do you consider cursors or while loops for a transactional database?

1011


What is data compression?

1066


What is index, cluster index and nonclustered index?

1046


Is mysql better than sql server?

1106


Explain the advantages of merge replication?

1010


Explain important index characteristics?

1076


What is snapshot report?

172


Explain user defined views?

1008


Why use view instead of a table?

1003


How many types of the database links?

1116


What are the dmvs? : sql server database administration

1120


Explain comment on transactions?

1041


Explain how does the report manager work in ssrs?

999


what are triggers? : Sql server database administration

952