Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

sql query performance, in vs join vs exists

OraCMay 15 2020 — edited May 15 2020

Can someone please give me the following statement with join and exists clauses and which one should work best for large data sets?

delete from CUSTOMERS where CUSTOMER_ID in (select CUSTOMER_ID from ORDERS where TRANSACTION_ID in (1,2,3,4))

CUSTOMERS table:

CUSTOMER_ID number(20)      -- primary key

CUSTOMER_NAME varchar2(20)

other columns

ORDERS table:

CUSTOMER_ID number(20)      -- primary key

TRANSACTION_ID number(20)     -- indexed column

other columns

Thanks,

OC

Comments
Post Details
Added on May 15 2020
5 comments
3,163 views