What is the exact difference b/w IN and EXIST in Oracle..?
Answer Posted / 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 |
Post New Answer View All Answers
How can we delete duplicate rows from flat files?
Explain how many types of dimensions are available in informatica?
Why do you use Mapping Parameter and mapping variable?
What happens when a session fails and you click on recover?
What are the steps involved in the migration from older version to newer version of Informatica Server?
how to create user defined function (udf) in informatica
complex mapping ur project u r invlve can u explain and give real time example give me ?
waht type of interface is used for testing the data in informatica
Suppose we do not group by on any ports of the aggregator what will be the output?
What the difference is between a database, a data warehouse and a data mart?
How many numbers of sessions can one group in batches?
Explain about Informatica server process that how it works relates to mapping variables?
CANNOT USE PARAMETER FILE! Hi all, I am trying to use parameter file for my workflow. This could help me to filter records where CITY = 'Portland' Following is what I have done: **in Designer - create new parameter : $$PARA_FIL, Parameter, String, IsExprVar=TRUE, Initial value = [empty] - Source Qualifier/ Properties/Source Filter: CUSTOMERS.CITY='$$PARA_FIL' **Create Parameter file: C:\Informatica\PowerCenter8.6.0 \server\infa_shared\BWParam\DynamicParamTest.txt $$PARA_FIL='Portland' **Configure workflow to use the parameter file: Edit Workflow/Properties/Parameter Filename: C:\Informatica\PowerCenter8.6.0 \server\infa_shared\BWParam\DynamicParamTest.txt I also configured directory of parameter file for session task. However, I just got this in the session log: [SQ_CUSTOMERS] SQL Query [SELECT CUSTOMERS.CUSTOMER_ID FROM CUSTOMERS WHERE CUSTOMERS.CITY='$$PARA_FIL'] No record has been loaded to target. It seems that the parameter file has not been read. I cannot understand the reason why. Could any of you kindly suggest me anything? Thanks
Which version configuration tool used in ur project?
how we can load rejected record's at run time?(not through bad files)