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 does a sorter cache works?
how to load rows into fact table in data warehouse
Mention few power centre client applications with their basic purpose?
Can u generate reports in Informatica?
Write the prerequisite tasks to achieve the session partition?
can anyone explain me about retail domain project in informatica?
What do you mean by DTM and Load manager and what is difference between load manager and load balancer?
What are the reusable transformations?
How you know when to use a static cache and dynamic cache in lookup transformation?
What are the popular informatica products?
How to create the list file having millions of flat files while indirect loading in informatica? In indirect file loading, suppose we have less no.of flat files then we can enter files names manually in list file creation. If millions of files are there, how can we enter the flat file names in list file?
what is the complex transformation you used in informatica
How can you validate all mappings in the repository simultaneously?
In informatica workflow manager, how many repositories can be created?
I have worked on Informatica 7.1.1. I want to know the answer for the below question. Target is not created initially.Then how to take the DDL script from the source and run the Mapping by creating the Target dynamically?Is it possible by SQL Transformation?