write a query to delete similar records in different tables
with same structure

Answers were Sorted based on User's Feedback



write a query to delete similar records in different tables with same structure..

Answer / vinoth kumar

DELETE FROM table1 WHERE
(col1,col2,..) IN (SELECT col1,col2,.. FROM table2 where
condition)

Is This Answer Correct ?    6 Yes 0 No

write a query to delete similar records in different tables with same structure..

Answer / radha sri seshu.kolla

while creating table and giving foreign key constraint give
the key word 'on delete cascade'.automatically when the
record in the master table is delated the relaeted record
in the detail table will also be deleted.

Is This Answer Correct ?    3 Yes 3 No

write a query to delete similar records in different tables with same structure..

Answer / umadevi

example

delete from emp where deptno in (select deptno from dept
where emp.deptno=dept.deptno);

Is This Answer Correct ?    3 Yes 5 No

write a query to delete similar records in different tables with same structure..

Answer / senthil

This done by Co-related sub-query:- based upon ROWID
uniqness this deletes the duplicate rows.

Delete from emp x where ROWID != (Select MIN(ROWID) from
emp y where y.empno = x.empno);

Is This Answer Correct ?    2 Yes 4 No

Post New Answer

More SQL PLSQL Interview Questions

cursor types? explain with example programs?

1 Answers   HP,


What is foreign key and example?

0 Answers  


How to find last day of the month in sql query

4 Answers  


Why we use sql profiler?

0 Answers  


I Defined SP1, Sp2 (sp=StoreProcedures)In Package Specification but I Implemented Sp1, sp2, sp3, sp4, sp5 then What type of Error You will find????

3 Answers   Infosys,






What is the use of a view in sql?

0 Answers  


How to run pl sql program in mysql?

0 Answers  


what is a foreign key ? : Sql dba

0 Answers  


How many types of normalization are there?

0 Answers  


What is diff between bulk collect and forall

3 Answers   Metric Stream,


in table there r so many rows write a query which two rows r updated last two day befor?

3 Answers   Exilant,


What is the need of a partition key?

0 Answers  


Categories