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

write a query to delete similar records in same table

Answer Posted / santosh kumar

simple answer for deleting duplicate record from a table.....
table:---
create table t1 (id number(5),name varchar2(20));

then:----
insert into t1 values(10,'a');
insert into t1 values(10,'a');
insert into t1 values(20,'b');
insert into t1 values(20,'b');
---after insertion it'll like this----
id name
10 a
10 a
20 b
20 b

-------------------------------------------------------------
delete from t1
where rowid not in (select min(rowid) from t1 group by name);

Is This Answer Correct ?    2 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

what is log shipping? : Sql dba

1059


Is big data nosql?

888


What are predefined functions in sql?

980


What are the key differences between SQL and PL SQL?

1149


What are the advantages of sql? Explain

1054


How does postgresql compare to mysql?

989


tell me about various levels of constraint. : Sql dba

991


What is the life of an sql statement?

964


Does asenumerable execute the query?

987


Under what condition it is possible to have a page level lock and row lock at the same time for a query? : Transact sql

928


What found sql?

898


What is the cause of mutating table error and how can we solve it?

995


List out the acid properties and explain?

905


What is data abstraction in sql?

969


What is the purpose of the partition table?

1003