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 a parameter query?

613


Is sql between inclusive?

578


What is the difference between instead of trigger and after trigger?

499


What are different types of statements supported by sql?

598


Why sql query is slow?

567






What is sql procedures and functions?

520


how many triggers are allowed in mysql table? : Sql dba

550


How to run sql commands in sql*plus?

573


When are we going to use truncate and delete?

541


Explain ddl statements in pl/sql?

568


How does stored procedure reduce network traffic?

531


Why stored procedure is better than query?

499


What is crud stand for?

557


how to convert character strings to numeric values? : Sql dba

562


How to avoid duplicate records in a query?

573