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 the difference between explicit and implicit cursors in oracle?

1008


What is left join in postgresql?

1002


What is the use of procedures?

930


What does cursor do in sql?

982


What are the benefits of stored procedures?

1010


how can I make a script that can be bi-language (supports english, german)? : Sql dba

954


What is memory optimized table?

992


What is integrity in sql?

988


how do you login to mysql using unix shell? : Sql dba

1031


Write a sql query to find the names of employees that begin with ‘a’?

963


how to enter binary numbers in sql statements? : Sql dba

936


How can you view the errors encountered in a trigger?

924


Can ddl statements be used in pl/sql?

1083


How is data stored on a disk?

974


What is consistency?

1073