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 are the types of operators available in sql?

769


Mention what is the function that is used to transfer a pl/sql table log to a database table?

658


what is bcp? When is it used?

765


How much does a sql dba make? : SQL DBA

666


What are some predefined exceptions in pl/sql?

740






Is grant a ddl statement?

632


Write a sql query to get the third highest salary of an employee from employee_table?

827


What is full join in sql?

712


What is where clause in sql?

731


What is data control language (dcl)?

785


how to get a list of all tables in a database? : Sql dba

687


How to create your own reports in sql developer?

726


What is embedded sql in db2?

708


What does inner join mean?

753


Explain what is a column in a table?

762