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 is oracle datasource?
How do I limit the number of oracle database connections generated by weblogic server?
How to view the data files in the current database?
How to connect to a local oracle 10g xe server?
What is varray?
What is a procedure in oracle?
How to assign values to data fields in record variables?
How to display employee records who gets more salary than the average salary in the department?
What is a user account in oracle?
What is sharded cluster?
Which is faster join or subquery in oracle?
Is oracle an operator?
How to call a sub procedure?
Explain what are the uses of rollback segment?
Explain oracle data types with examples?