write a query to delete similar records in same table

Answer Posted / sivadasan

I think simply we can do like the following..

1. First we have to transfer all data from a table to
temporary table

create table Temp_table as select * from original_table;

2. Delete all record from Original Table....

delete original_table;

3. Now we can write a query by using INSERT and UNION

If any issue let me know....

insert into original_table (select * from temp_table
UNION select * from UNION )

Is This Answer Correct ?    0 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is meant by cursor in sql?

738


What will you get by the cursor attribute sql%notfound?

793


in oracle 10g sw after compiling procedure how to pass parameter values ,if we (v_empid out number)how to give empid after successful compilation program.This site exact suitable for 10g with respect to question & answer same format , im trying sql browser & sql command prompt using exec procedure name & respective parameters.

1847


How do I run sql?

834


What is the difference between a procedure and a function?

710


Is sqlexception checked or unchecked?

730


what is isam? : Sql dba

780


How many sql statements are used?

759


Is and as keyword in pl sql?

693


What is fmtonly in sql?

729


Explain the rollback statement?

781


What are the basic sql commands?

775


Which is better join or subquery?

809


what are the different type of sql's statements ? : Sql dba

710


What is a sql instance vs database?

776