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 |
How to load query faster,so that It will take less time to load?
I have done MBA in 2008. i got job as business analyst in 2008 january through consultany. but after 3 months they are giving training Informatica developer. now iam continuing this job. my question is when iam going to interview HR people ask me many times like this " YOU ARE MBA GRADUATE. HOW YOU ARE SELECT THIS POSTION. IAM EXPLAINING WHAT I HAVE MENTION ABOVE". PLEASE TELL HOW IAM TELLING THIS QUESTION ANSWER.
What will happen when Mapping variable and Mapping parameter is not defined or given? Where do you use mapping variable and mapping parameter?
What are the Differences between static cache and dynamic cache?
What is the use of target designer?
How we can get unique records into one target table and duplicate records into another target table??
11 Answers Deloitte, IBM, iGate,
i hav a scenario like this i want load data from source to target as follows frist it counts the num of deptno and display with that with count and how many times it reapts along with all the records in source
Hi All can anyone tell me where i will get Informatica training in Mumbai?
without using emailtask how will send a mail from informatica?
what are the fact table & dimensional table in pharmaceutical and hospotal related products???
i have a table like empid ename year month sal 1 x 98 jan 500 1 x 98 feb 500 1 x 98 mar 500 1 x 99 jan 600 1 x 99 feb 600 2 y 98 jan 600 2 y 98 feb 600 2 y 98 mar 600 2 y 99 jan 700 2 y 99 jan 700 and so on i want to find out totsal for every emp on year wise plz help me
What are the basic needs to join two sources in a source qualifier?