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 / umadevi

--deletes records within table without changing table name
delete from temp t1 where rowid<(select max(rowid) from temp
t2 where t1.empno=t2.empno) order by empno;

or
--create new table n insert records.
create table t1 as select distinct * from temp;

or
(truncate table)
truncate table t1;
insert into t1 select distinct * from temp;

Is This Answer Correct ?    1 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How many types of relationship are there?

1040


what is a tablespace? : Sql dba

1067


Is a secondary key the same as a foreign key?

1050


How does join work in sql?

1021


Why use truncate instead of delete?

1024


What is a ddl command?

1097


What is sql server and ase?

1037


What is the use of nvl function?

1209


what are the difference between clustered and a non-clustered index? : Sql dba

1038


Is it possible to remove child records without removing master table records...the two having pk,fk relationship?

1277


Does inner join return duplicate rows?

998


discuss about myisam key cache. : Sql dba

1024


Why we use join in sql?

984


What is scope of pl sql developer in future?

1031


What is insert command in sql?

1139