What is the main difference between the IN and EXISTS clause in subqueries??
The main difference between the IN and EXISTS predicate in subquery is the way in which the query gets executed.
IN -- The inner query is executed first and the list of values obtained as its result is used by the outer query.The inner query is executed for only once.
EXISTS -- The first row from the outer query is selected ,then the inner query is executed and , the outer query output uses this result for checking.This process of inner query execution repeats as many no.of times as there are outer query rows. That is, if there are ten rows that can result from outer query, the inner query is executed that many no.of times.
Questions by rajanipriya answers by rajanipriya
Showing Answers 1 - 3 of 3 Answers
Related Answered Questions
Related Open Questions
What is the main difference between the IN and EXISTS clause in subqueries??
IN -- The inner query is executed first and the list of values obtained as its result is used by the outer query.The inner query is executed for only once.
EXISTS -- The first row from the outer query is selected ,then the inner query is executed and , the outer query output uses this result for checking.This process of inner query execution repeats as many no.of times as there are outer query rows. That is, if there are ten rows that can result from outer query, the inner query is executed that many no.of times.
Profile Answers by rajanipriya Questions by rajanipriya
Questions by rajanipriya answers by rajanipriya
Related Answered Questions
Related Open Questions