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
What is a table?
How insert into statements in sql?
What are different sql data types?
How to select unique records from a table?
What is the difference between the conventional and direct path loads? : aql loader
Is join and inner join the same?
If i can use sys.check_constraints to display my constraints from my database using sql server 2005, how can i display then if i am using sql server 2000????
Does sqlite need a server?
explain normalization concept? : Sql dba
what is index? : Sql dba
First round ------------------- - Procedure - Packages - Views - Virtual tables - Can we use dcl with in function? - Joins and few scenarios - Triggers and its type - Pragma, type and its functionality - How to create db link in oracle - Materialized view - How to find duplicate values from table? - Cursor and its functionality - Write a script to display friday and its date from a entire year. - Exception Handling Second round ------------------------ Gave a scenario like. Need to write a function to perform. When user try to change a password. It must not be last five password and a given password can be combination of characters, symbols, upper and lower case.
What is sql injection owasp?
What is a column in a table?
what are the advantages a stored procedure? : Sql dba
Can we use joins in subquery?