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 ? | 2 Yes | 0 No |
Post New Answer View All Answers
How can deadlocks be resolved?
What is host variable in db2 cobol?
Mention the way of highlighting as well as putting a cursor to use in a cobol program.
How do you simulate the explain of an embedded sql statement in spufi/qmf?
What is rct?
Who uses db2?
What is precompiler in db2?
While unloading huge amount of data from table. Suddenly job failed some error. Imagine 1M data unloading, In that 90% data unloaded only 10% left, So if want to unload the rest 10% what needs to be done? Whether do i need to start from top or anything ?
B37 abend during spufi?
How can record locking be achieved in those DB2 versions which do not support it?
What is the advantage in De-normalizing tables in DB2?
Which isolation level provides highest data integrity?
What is check constraint in db2?
What are the benefits of using the db2 database?
Where do you specify them?