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 list all user accounts in oracle?
How to create an oracle database manually?
How to delete a user account in oracle?
How to convert csv to table in oracle?
What is a data dictionary and how can it be created?
How many types of cluster table in Oracle?
Is truncate autocommit in oracle?
How to bring a tablespace online?
Is it possible to insert comments into sql statements return in the data model editor ?
Difference between varchar and varchar2 data types?
How to do paging with oracle?
why dont we assign not null constraint as table level constraint.
What operating systems are supported by oracle database 10g xe?
How to do clean up if create database failed?
Briefly explain what is literal? Give an example where it can be used?