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 are all the common sql function? : Sql dba

1062


What is %type in pl sql?

973


what is the command line end user interface - mysql? : Sql dba

985


What are different types of queries in sql?

1123


how tsql statements can be written and submitted to the database engine? : Transact sql

1002


Can we use ddl statements in stored procedure?

1155


What is trigger in sql? Explain

999


list out some tools through which we can draw e-r diagrams for mysql. : Sql dba

970


What is the use of procedures?

977


Can we create clustered index without primary key?

971


What is sql not null constraint?

1044


explain advantages of myisam over innodb? : Sql dba

1072


How do I view a sql database?

1023


How do you update a value in sql?

1048


Can you join a table to itself?

1139