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
How to view the data files in the current database?
How to get execution path reports on query statements?
What is a subquery?
What is columnar storage what is the advantage?
if you ctreate table identity
How to convert character types to numeric types?
What are the ways tablespaces can be managed and how do they differ?
What is the use of aggregate functions in oracle?
How to see the table columns used in an index?
what are steps for interface? where is exchange rate defined in which table?
What happens to the current transaction if the session is ended?
What is a cursor in oracle?
Can we write insert statement in function in oracle?
How to define an oracle cursor variable?
What is index in Oracle?