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
Can informatica load heterogeneous targets from heterogeneous sources?
What are the different options available for update strategy?
What is Cognos script editor?
How to do unit testing in informatica?
Define enterprise data warehousing?
How would you copy the content of one repository to another repository?
What is substr in informatica?
Describe expression transformation?
Differentiate between reusable transformation and mapplet.
pmscmd startworkflow -sv
in staging we are merging the data and remove the inconsistants data that type of situation what u will done and type of functions u can use
What are the new features of Power Center 5.0?
What is the surrogate key?
What will happen if the select list columns in the custom override sql query and the output ports order in sq transformation do not match?
What is meant by pre and post session shell command?