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...

if 3 duplicate records in a table,i want to delete 2 duplicate
records by keeping 1 as it is,how?

Answer Posted / venkat

if u r table like this
sno sname fee
1 a 1000
1 a 1000
2 b 1000
2 b 1000
3 c 1000
3 c 1000
--- write this
with duplicatecte
as
(select row_number()over(partition by sno,sname order by fee
)as rnum from students )
delete from dupcte where rnum>1

---run this query
select * from students
--out put is
1 a 1000
2 b 1000
3 c 1000

this is correct

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What's the information that can be stored inside a bit column?

1008


what is isolation level at dead lock?

2156


What is store procedure? When do you use?

939


Please explain what is “asynchronous” communication in sql server service broker?

942


Difference between DELETE and TRUNCATE?

1056


What is difference between count (*) and count column?

910


What is field with example?

931


Do you know what is user defined datatypes and when you should go for them?

968


What is the language structure to add a record to a table?

1026


Define cross join in sql server joins?

1028


What is openrowset sql server?

1139


What is the New in SQL server 2008?

981


Tell me about normalization in DBMS.

1000


What does it mean to be in union?

936


What are the various Operating system files that every SQL server 2005 database has and what is the purpose.

1066