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 sql engine in oracle?
What is varchar used for?
How is a PL/SQL code compiled?
what is meant by urlencode and urldocode? : Sql dba
Can we alter stored procedure?
How can you select unique records from a table?
What is clause in sql?
what are myisam tables? : Sql dba
What is range partitioning?
Differentiate between % rowtype and type record.
What is using in sql?
What is having clause in sql?
Where the sql database files are stored?
what is query cache in mysql? : Sql dba
What is a recursive stored procedure?