What is the exact difference b/w IN and EXIST in Oracle..?
Answers were Sorted based on User's Feedback
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 |
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 |
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 |
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 |
HOW DO YOU CONNECT TO REMOTE SERVER ?
i have source as Column1 101 a 101 b 101 c so i want to load target as column1 ---> 101 abc
What is degenerated dimention table?
What are the different lookup cache(s)?
why we r using presql&postsql in source qualifier?
Informatica Server and Client are in different machines. You run a session from the server manager by specifying the source and target databases. It displays an error. You are confident that everything is correct. Then why it is displaying the error?
What is the exact difference b/w IN and EXIST in Oracle..?
What is workflow? What are the components of workflow manager?
server hot-ws270 is connect to Repository B. What does it mean?
wat are deployement groups in informatica, how it will be used for developers
case and like function in informtica (my source is XML). case when OS Like'%Windows%' and OS Like '%200%' then 'Windows 200' case when OS Like'%Windows%' and OS Like '%200%'and OS like '%64%' then 'windows 200 64 bit' etc.,,
What is a parameter When and where do you them when does the value will be created