What is the difference between IN and Exists in Oracle?
Answer Posted / pankaj
In sql server,
WHEN YOU USE 'IN', WHILE CHECKING FOR WHERE CONDITION SQL SERVER ENGINE DOES WHOLE TABLE SCAN. IF YOU USE 'EXISTS' AS SOON AS ENGINE FINDS THE REQUIRED ROW IT WILL STOP EXECUTING QUERY AND GOING FURTHER SCANNING TABLE.
In Oracle,
EXISTS is very faster than IN (when the subquery results is very large)
IN is faster than EXISTS (when the subquery results is very small)
In Example -
select ename from emp
where mgr in (select empno from emp where ename = 'KING');
Exists Example -
Select ename from emp a where exists ( select 0/null from emp b where a.mgr=b.empno and ename='KING')
| Is This Answer Correct ? | 3 Yes | 1 No |
Post New Answer View All Answers
How many number of sessions can one group in batches?
list out all the transformations which use cache?
Is stop and abort are same in informatica?
Explain about Informatica server process that how it works relates to mapping variables?
What does refresh system mean, and what are its distinctive choice?
What do you mean by worklet?
What is a sorter transformation?
Explain scd type 3 through mapping.
Performance tuning in UNIX for informatica mappings?
How can one identify whether mapping is correct or not without connecting session?
Do you find any difficulty while working with flat files as source and target?
How to differentiate between the active and passive transformations?
How to extract sap data using informatica? What is abap? What are idocs?
explain about unit testing? in real time?
what is song in infrmatica...?