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

What are inbuilt functions in sql?

588


What are three advantages to using sql?

542


What is the difference between the sql*loader and import utilities? : aql loader

591


What are different types of indexes?

506


How to use boolean type in select statement?

574






What is mutating table error?

650


How insert into statements in sql?

586


what are the limitations of mysql in comparison of oracle? Mysql vs. Oracle. : Sql dba

535


What are different types of keys?

517


what are the t string functions available in tsql? : Transact sql

533


Can 2 queries be executed simultaneously in a distributed database system?

636


Does mysql support pl sql?

615


What is a database event trigger?

581


what is top in tsql? : Transact sql

533


Explain what is sql?

598