OraQA

Oracle Question and Answer

  • Do you have a solution to a problem? Do you have an unanswered question? Login and share it with the Oracle community. More...

Oracle News


Entries RSS feed

Comments RSS feed

What is an inline view?

June 13th, 2006 By Eddie Awad

Definition

An inline view is a SELECT statement inside another SELECT statement.

Examples

 SELECT *
   FROM employees e
  WHERE e.department_id IN (SELECT d.department_id
                              FROM departments d
                             WHERE d.location_id = 1700)

 /
 SELECT dept.*,
        emp.emp_cnt
   FROM (SELECT   department_id,
                  COUNT (*) emp_cnt
             FROM employees
         GROUP BY department_id)
emp,
        departments dept
  WHERE dept.department_id = emp.department_id
 /

Resources

One Response to “What is an inline view?”

  1. anonymous.nospam Says:

    Actually, the optimizer will execute an inline view exactly the same way it would execute an ordinary view. There is a related thread at Oracle Forums.

Leave a Reply

You must be logged in to post a comment.

RSS feed for comments on this question