CODE
Oracle Code Library
JOBS
Find Or Post Oracle Jobs
FORUM
Oracle Discussion & Chat
PSOUG Home Code Snippets Oracle Reference Oracle Functions PSOUG Forum Oracle Blogs Bookmark and Share
 
 Search the Reference Library pages:  

Free
Oracle Magazine
Subscriptions
and Oracle White Papers

Oracle Inline Views
Version 11.1
 
Basic Inline View Select

Single Table
SELECT <column_name_list>
FROM (
  <SELECT_statement>);
SELECT object_type, COUNT(*)
FROM all_objects
GROUP BY object_type
;

SELECT object_type
FROM (
  SELECT object_type, COUNT(*)
  FROM all_objects
  GROUP BY object_type
);

SELECT object_type
FROM (
  SELECT object_type, COUNT(*) OTCNT
  FROM all_objects
  GROUP BY object_type)
WHERE otcnt > 100;
 
In-line View with Join

Join In-line views
SELECT <column_name_list>
FROM (
  <SELECT_statement>) <alias_1>
     (
  <SELECT_statement>) <alias_2>
WHERE alias_1.condition = alias_2.condition;
SELECT table_name, num_rows
FROM user_tables
;

SELECT index_name, table_name
FROM user_indexes
;

SELECT num_rows, index_name
FROM (SELECT table_name, num_rows FROM user_tables) a,
    
(SELECT index_name, table_name FROM user_indexes) b
WHERE a.table_name = b.table_name(+);
 
Related Topics
SELECT Statement
 
Home      :      Code Library      :      Sponsors      :      Privacy      :      Terms of Use      :      Contact Us [202 users online]    © 2010 psoug.org