• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 3869
  • Last Modified:

Delete Statement with Inner Join

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
jknj72
Asked:
jknj72
1 Solution
 
johnsoneSenior Oracle DBACommented:
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
 
jknj72Author Commented:
thanks
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now