write a query to delete similar records in different tables
with same structure
Answers were Sorted based on User's Feedback
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 |
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 |
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 |
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 |
Which data dictionary views have the information on the triggers that are available in the database?
Determine if oracle date is on a weekend?
Can we call stored procedure in function?
What is a database event trigger?
what is the order of pre-defined exceptions.
what are pl/sql collections?
4 Answers JPMorgan Chase, Oracle,
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????
I have the table like this S.No Name ID 01 Xyz 123 I want the result as 01Xyz123 How to write the query to retrieve the entire row data in a single column?
What is nvarchar max in sql?
What is dense_rank in sql?
what is meant by tuning and tk proof?
How do you truncate?