How many levels can subqueries be nested in a FROM clause?

Answer Posted / slokh

FROM clause
A subquery can also be found in the FROM clause. These are
called inline views.

For example:

select suppliers.name, subquery1.total_amt
from suppliers,
(select supplier_id, Sum(orders.amount) as total_amt
from orders
group by supplier_id) subquery1,
where subquery1.supplier_id = suppliers.supplier_id;

In this example, we've created a subquery in the FROM
clause as follows:

(select supplier_id, Sum(orders.amount) as total_amt
from orders
group by supplier_id) subquery1

This subquery has been aliased with the name subquery1.
This will be the name used to reference this subquery or
any of its fields.

Limitations:

Oracle allows an unlimited number of subqueries in the FROM
clause.

Is This Answer Correct ?    10 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What's the difference between inner join and left join?

482


What is identity column in sql server?

493


What is Difference Between Unique and Primary Key Constraints?

573


how to implement one-to-one, one-to-many and many-to-many relationships while designing tables? : Sql dba

518


Why select is used in sql?

490






What does fetching a cursor do?

593


What is the difference between rename and alias?

678


What does the file extension accdb stand for?

529


What is sql table?

500


what is a constraint? : Sql dba

682


Explain what is a column in a table?

552


What is delimiter in pl sql?

565


Difference between table function and pipelined function?

559


Is there any restriction on the use of union in embedded sql?

634


How do I tune a sql query?

489