Solved

Delete Statement with Inner Join

Posted on 2013-06-17
2
3,561 Views
Last Modified: 2013-06-18
I know in SQL its something like this but I just read something and Im curious if I can do this in Oracle? Its a Inner Join on the same table but with different keys

Delete
from omni_common_lookup a
inner join omni_common_lookup b on A.LOOKUP_CODE = B.LOOKUP_SUB_TYPE_CODE
where a.lookup_key LIKE 'ALERT_ITEMS_%' and b.lookup_key= 'ALERT_EMP_PEOPLE';

Can this be done in Oracle?

THANKS
0
Comment
Question by:jknj72
2 Comments
 
LVL 34

Accepted Solution

by:
johnsone earned 500 total points
ID: 39254373
DELETE FROM omni_common_lookup a 
WHERE  lookup_keyu LIKE 'ALERT_ITEMS_%' 
       AND EXISTS (SELECT 1 
                   FROM   omni_common_lookup b 
                   WHERE  a.lookup_code = b.lookup_sub_type_code 
                          AND b.lookup_key = 'ALERT_EMP_PROFILE') 

Open in new window

0
 

Author Closing Comment

by:jknj72
ID: 39257151
thanks
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
sql join/ assign small # first 10 81
How can I exclude some wording in a like statement? 39 65
How does this SELECT query work 11 99
SQL Query resolving a string conversion issue 26 37
CCModeler offers a way to enter basic information like entities, attributes and relationships and export them as yEd or erviz diagram. It also can import existing Access or SQL Server tables with relationships.
Creating and Managing Databases with phpMyAdmin in cPanel.
This video shows setup options and the basic steps and syntax for duplicating (cloning) a database from one instance to another. Examples are given for duplicating to the same machine and to different machines
Via a live example, show how to restore a database from backup after a simulated disk failure using RMAN.

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now