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 the difference between substr and instr function in oracle?
Explain the difference between a procedure and a function?
Explain oracle’s server parameter file.
Explain what are the advantages of views?
can u send the sql dumps to sivakumarr1987@gmail.com plz help me
What is oracle update statement with inner join ?
Is oracle an operator?
WHAT IS THE DEFINITION OF DEFAULT CUSTOMER IN AR?
How would you configure your networking files to connect to a database by the name of DSS which resides in domain icallinc.com?
What is a snapshot log?
Is oracle a programming language?
How to display row numbers with the records?
What do you understand by a database object? Can you list a few of them?
Can group functions be used in the order by clause in oracle?
How will you write a query to get a 5th rank student from a table student_report?