write a query to delete similar records in same table

Answer Posted / sivadasan

Sorry for the previous answer....

We can do like this ,

1. First we have to transfer all data from original_table
table to a 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

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

any issues let me know.....

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is where clause in sql?

734


What is sql*loader and what is it used for? : aql loader

804


what does it mean to have quoted_identifier on? What are the implications of having it off? : Sql dba

721


What is a left join?

691


Table 1: col1 Timestamp ---------------- 01-mar-2012 11:12:46 Table 2: col2 Timestamp -------------------- 01-mar-2012 11:12:10 01-mar-2012 11:11:23 Write a query to display a row with table2 col2 value less than tabl1 col1 value. Maximum timestamp value previous to table1 col1 value. Display a result as: Col1 col2 ----- ----- 01-mar-2012 11:12:46 01-mar-2012 11:12:10

1899






Which join condition can be specified using on clause?

702


table structure: ---------------- col1 col2 ----- ----- 01-mar-2012 11:12:46 01-mar-2012 11:12:10 01-mar-2012 11:12:46 01-mar-2012 11:11:23 Write a query to display the result as shown below: col1 col2 ----- ----- 01-mar-2012 11:12:46 01-mar-2012 11:12:10

3715


What does the sign mean in sql?

704


What is numeric function sql?

722


Is sql a scripting language?

690


what is a constraint? : Sql dba

882


What does the base_object_type column shows in the user.triggers data dictionary view?

758


How to run sql functions in pl/sql?

723


What is database white box testing and black box testing?

848


How do sql triggers work?

741