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 the use of double ampersand (&&) in sql queries? Give an example
Which language is used in sql?
Explain exception handling in pl/sql?
Which is faster subquery or join?
Is sql injection illegal?
What is the difference between sql and isql*plus?
What is difference between function and trigger?
Explain polymorphism in pl/sql.
What is a scalar value in sql?
How do you pronounce sql?
What is the use of stored procedures?
Why is pl sql needed?
what are the differences between require and include, include_once and require_once? : Sql dba
How does a trigger work?
what is bcp? When is it used?