What is the difference between IN and Exists in Oracle?
Answers were Sorted based on User's Feedback
Answer / ram
exists improves the performance because it returns boolian
value where as 'in' is not...so exists simplyfies internal
calculations....
| Is This Answer Correct ? | 9 Yes | 1 No |
Answer / 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 |
Answer / imran
The EXISTS clause is used to check the existence of rows returned by a subquery. It returns TRUE if the subquery returns one or more rows.
The IN clause is used to filter rows based on a list of values or a subquery result set. It checks if a value matches any value in a list or subquery.
| Is This Answer Correct ? | 0 Yes | 0 No |
Answer / sri
when the condition is in a subquery then in will be used
where if there is a condition in superquery
(parent) exists will be used. Usage of IN will improve the
performance
| Is This Answer Correct ? | 0 Yes | 10 No |
What do you understand by term role-playing dimension?
Data is passed from one active trans and one passive trans into a passive transformation.Is the mapping valid or invalid?
hi all, can anyone tell where i will get good informatica training in Pune? thanks in advance.
Can any one describe what is audit table briefly?how does it look like and what are the columns in it?
what is the end to end process meaning in my project(my project is development)and functionality plz tell me
What are the static cache and dynamic cache in informatica?
What is incremental aggregation and how it is done?
8 Answers JPMorgan Chase, TCS,
As union transformation gives UNION ALL output, how you will get the UNION output?
what we require for D.modelling?
how can import the data from the flat files?
How/where can i install Informatica software with oracle or teradata as database
suppose i have source 101 a 101 b 101 c 101 d i want target like 101 abcd how will u achive this please give me the answer