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 a scheduled jobs or what is a scheduled tasks? : Sql dba
Determine if oracle date is on a weekend?
Why does sql need a server?
What is record data type?
How do I run a program in pl sql?
What is data definition language?
Why truncate is used in sql?
What is sqlerrd?
What are sql triggers used for?
Is pl sql better than sql?
Are subqueries faster than joins?
What is package in pl sql with an examples?
How do I view a sql trace file?
what is acid property in database? : Sql dba
What is the most restrictive isolation level? : Transact sql