exists vs in. just checking my understanding
where emp_no in(select emp_no
where title = 'Assistant Engineer');
I used this query and got the same no of rows returned.
Assuming that this is indeed correct, we need to use e.title = t.title in case of exists because exists does not return any value but simply checks if the statement is true and in case of in, even if we just check for the given job title, as it is returning all the emp_no for which the title is Assistant Engineer we dont need to check for this condition.
Did I understand this correctly?
1 answers ( 0 marked as helpful)
Thanks for reaching out.
Yes, you got it right! If we use the EXISTS operator we need to add the condition you mentioned.
Hope this helps.