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 is an invalid partition table?

750


What is inner join in sql?

775


What is dcl in sql?

696


What program will open a mdb file?

682


What is pl sql commands?

732






What is use of trigger?

677


What is cartesian join in sql?

744


What are all the different normalizations?

745


How does sql developer connect to oracle database?

744


Explain constraints in sql?

768


What is orm in sql?

723


What is a design view?

702


What are character functions?

804


How exception is different from error?

764


what is the different between now() and current_date()? : Sql dba

705