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
Which sql statement is used to delete data from a database?
What is rank function in sql?
what is the difference between blob and text? : Sql dba
Why do we need a foreign key?
What are the basic techniques of indexing?
mention if it is possible to import data directly from t-sql commands without using sql server integration services? If yes, what are the commands? : Transact sql
What is the difference between rename and alias?
what is a materialized view? : Sql dba
what is dbms? : Sql dba
what are the nonstandard string types? : Sql dba
what is csv? : Sql dba
How many types of cursors are available in pl/sql?
what is auto increment? : Sql dba
What is secondary key?
What is rownum and rowid?