What is the exact difference b/w IN and EXIST in Oracle..?

Answers were Sorted based on User's Feedback



What is the exact difference b/w IN and EXIST in Oracle..?..

Answer / venkateshmalneni

EXIST is used as conditional operator in which u can write a query
IN is also used as a conditional operator in which we gives a list of elements

Is This Answer Correct ?    4 Yes 1 No

What is the exact difference b/w IN and EXIST in Oracle..?..

Answer / moorthy g

select ename from emp e
where mgr in (select empno from emp whereename = 'KING');

Here's the EXPLAIN PLAN for this query:

OBJECT OPERATION
---------- ----------------------------------------
SELECTSTATEMENT()
NESTEDLOOPS()
EMP TABLEACCESS(FULL)
EMP TABLEACCESS(BY INDEX ROWID)
PK_EMP INDEX(UNIQUESCAN)

This query is virtually equivalent to this:

select e1.ename from emp e1,(select empno from empwhere
ename = 'KING') e2
where e1.mgr = e2.empno;

You can write the same query using EXISTS bymoving the outer
query column to a subquery condition, likethis:

select ename from emp e
where exists (select 0 from emp wheree.mgr = empno and
ename = 'KING');

When you write EXISTS in a where clause, you'retelling the
optimizer that you want the outer query to be runfirst,
using each value to fetch a value from the inner
query(think: EXISTS = outside to inside).

Is This Answer Correct ?    2 Yes 0 No

What is the exact difference b/w IN and EXIST in Oracle..?..

Answer / sujeetha

It is almost similar to IN but the difference is that in
EXIST it will retrive the row atleast one row in the inner
query satisfies but in IN we can have manuy values

Is This Answer Correct ?    1 Yes 0 No

What is the exact difference b/w IN and EXIST in Oracle..?..

Answer / pavan_615

IN- sub Query - it will be executed once for the full query
Exist - Co-related sub Query - it will be executed for each
row.-- exist will me faster when you are working with big
tables.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Informatica Interview Questions

What is workflow manager?

0 Answers  


i have a session which creates a file every time when i runs the session, but it replaces the first file with second file,i want to append the second file follwed by first file when i runs the session,how to achieve this?

1 Answers   Thomson Reuters,


How to display session logs based upon particular dates. If I want to display session logs for 1 week from a particular date how can I do it without using unix. ?

0 Answers   CTS,


HOE DO U IMPLIMENT SCHEDULING IN INFORMATICA?

7 Answers   Patni, Wipro,


Hi, What is version control in Informatia ? Can anyone just give an idea or introduction about this? Advance Thanks

2 Answers   IBM,






What is partioning?how many types of partinings are there

2 Answers   HCL,


What is the diff. b/w informatica versions 8.1.1 and 8.6.1?

4 Answers   IBM, Wipro,


there is a mapping with expression and mapping we create some condition for insert and update and followed by update startegy ,can we update and insert on a single target based on condition?

1 Answers   Emphasis,


How can you generate reports in informatica?

0 Answers  


i have 5 session (s1,s,2,s3,s4,s5)i want to execute first 4 session after 5th session how will you do?

8 Answers   iNautix,


i have a source which relational.I am trying to populate to target flat file with one column for daily date which is sysdate. I want to populate the sysdate coulmn with DD/MM/YYYY format. kindly provide a solution for this..my clear that my target is flat file.

3 Answers  


Source Qualifier is an active t/r but there is no change of row count then y should we called it active t/r & Router , sorter some times no change in row count then Y we called its active t/r?

2 Answers  


Categories