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
what is log shipping? : Sql dba
Is big data nosql?
What are predefined functions in sql?
What are the key differences between SQL and PL SQL?
What are the advantages of sql? Explain
How does postgresql compare to mysql?
tell me about various levels of constraint. : Sql dba
What is the life of an sql statement?
Does asenumerable execute the query?
Under what condition it is possible to have a page level lock and row lock at the same time for a query? : Transact sql
What found sql?
What is the cause of mutating table error and how can we solve it?
List out the acid properties and explain?
What is data abstraction in sql?
What is the purpose of the partition table?