Difference between sub query and nested query ?
Answer Posted / lakshmi
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)
| Is This Answer Correct ? | 96 Yes | 11 No |
Post New Answer View All Answers
What will be the syntax to find current date and time in format "yyyy-mm-dd"?
What is Undo Management Advisor in Oracle?
What is set verify off in oracle?
How to download oracle database 10g xe?
How to start an oracle instance?
How to work with data objects interactively?
How can I convert single byte kana characters into multi byte kana characters and vice-versa.
Explain the use of owner option in exp command.
What does sharding mean?
How to use like conditions in oracle?
What is the data type of dual table?
What are the restrictions in a oracle read only transaction?
How to assign values to data fields in record variables?
How do I connect to oracle database?
What is user managed backup in Oracle?