Solved

Delete Statement with Inner Join

Posted on 2013-06-17
2
3,528 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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

APEX (Application Express) is used to develop a web application from Oracle. SQL Workshop is one of the tools that comes with Oracle APEX to query or modify the database objects or to make any changes to the structure.
Many companies are looking to get out of the datacenter business and to services like Microsoft Azure to provide Infrastructure as a Service (IaaS) solutions for legacy client server workloads, rather than continuing to make capital investments in h…
This video shows how to Export data from an Oracle database using the Original Export Utility.  The corresponding Import utility, which works the same way is referenced, but not demonstrated.
This video shows how to configure and send email from and Oracle database using both UTL_SMTP and UTL_MAIL, as well as comparing UTL_SMTP to a manual SMTP conversation with a mail server.

707 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

16 Experts available now in Live!

Get 1:1 Help Now