Could anyone clearly explain the diference between sub
query and correlated sub query?
Answer Posted / sriram
Correlated subquery runs once for each row selected by the
outer query. It contains a reference to a value from the
row selected by the outer query.
Nested subquery runs only once for the entire nesting
(outer) query. It does not contain any reference to the
outer query row.
For example
Correlated Subquery:
select e1.empname e1.basicsal e1.deptno from emp e1 where
e1.basicsal (select max(basicsal) from emp e2 where
e2.deptno e1.deptno)
Nested Subquery:
select empname basicsal deptno from emp where (deptno
basicsal) in (select deptno max(basicsal) from emp group by
deptno)
Please let me know if I am wrong...............
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
run jcl for cobol+db2 pgm?.. //jobcard //step001 exec pgm=ikjeft01 //systin dd * DSNSYSTEM(--------) RUN PROGRAM(MYPGMNAME) PLAN(-----), LIB(-------), PARMS(------) /* WHAT WILL U GIVE INSIDE THE BRACKETS... WHAT IS PLAN,PACKAGE,BIND?..PLAN N PACAKGES ARE GENERATED BY ?...
what is the responsibility of the construction superintendent
List some fields from sqlca?
Is ibm db2 open source?
Which components manage deadlocks in db2?
What is temporal table in db2?
Mention the various locks that are available in db2.
Who uses db2?
Which component is used to execute the sql statements?
What action db2 takes when a program aborts in the middle of a transaction?
How can the firstname and the lastname from the emp table be concatenated to generate complete names?
If I have a view which is a join of two or more tables, can this view be updateable?
What is declare cursor?
What is table space in db2?
What is db2? Explain.