Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

Define update strategy?

1214


What is a code page?

1173


What is sq transformation?

1158


What is the need of an ETL tool?

1083


What are the prerequisite tasks to achieve the session partition?

1249


Mention few power centre client applications with their basic purpose?

942


What is a sorter transformation?

1101


What is option by which we can run all the sessions in a batch simultaneously?

1137


What are the types of schemas we have in data warehouse.

952


What happen when you enable grid option avilable at session level ? (Ans found: Scalabily . A single session Parallelization) But how can one session is sharable among different nodes at the same time while running ?

2359


What do you understand by term role-playing dimension?

1044


what are the fact table & dimensional table in pharmaceutical and hospotal related products???

2132


How you can differentiate between connected lookup and unconnected lookup?

1059


tell me 5 session failure in real time how can you solve that in your project?

2290


How does a rank transform differ from aggregator transform functions max and min?

1200