Quick Search:
 
 Oracle PL/SQL: TABLE: Using Select Statement With Data Jump to:  
Category: >> Oracle PL/SQL >> TABLE: Using Select Statement With Data  

<< lastnext >>

Snippet Name: TABLE: Using Select Statement With Data

Description: Create Table Using a Select statement

CREATE TABLE AS creates a table from the result of a SELECT statement. All of the expressions that can be used in a SELECT statement can be used in a CREATE TABLE AS statement. You can also include all of the data from the table or tables that you are selecting from.

Also see:
» Get and set select lists with Javascri...
» Selecting a Random Row
» TABLESPACE: Show contiguous space
» TABLESPACE: SYSAUX tablespace
» TABLESPACE: Tablespace management
» TABLESPACE: List tablespaces, files, ...
» TABLESPACE: Dropping Tablespaces
» TABLESPACE: Alter Permanent Tablespace
» TABLESPACE: Transportable tablespaces
» TABLESPACE: Tempfile operations
» TABLESPACE: Create temp tablespace
» TABLESPACE: Change UNDO tablespace
» TABLESPACE: Undo Tablespace
» TABLESPACE: SYSAUX Tablespace
» TABLESPACE: Set default tablespace type
» TABLESPACE: Oracle Managed Auto-extend...
» TABLESPACE: Permanent Tablespace Using...
» TABLE: Constraints
» TABLE: Options
» TABLE: Using Select Statement With Data
» TABLE:  Multiple Columns
» TABLE:  queries
» TABLE: simple heap table
» TABLESPACE: Using Raw Devices
» TABLESPACE: permanent tablespace
» SELECT: Case insensitive search
» SELECT: Partition Select
» SELECT: Select For Update
» SELECT: Using Functions
» SELECT: Get DISTINCT or UNIQUE values

Comment: (none)

Language: PL/SQL
Highlight Mode: PLSQL
Last Modified: March 11th, 2009

WITH data
 
CREATE TABLE  test3 AS
SELECT table_name, tablespace_name
FROM all_tables;
 
---------------------------------
 
without data
 
CREATE TABLE  ctas AS
SELECT table_name, tablespace_name
FROM all_tables
WHERE 1=2;
 
 
-- For example, create a table named EMPLOYEE3 that includes all 
-- of the column definitions from EMPLOYEE where the DEPTNO = D11.
 
CREATE TABLE EMPLOYEE3 AS
   (SELECT PROJNO, PROJNAME, DEPTNO
    FROM EMPLOYEE
    WHERE DEPTNO = 'D11') WITH NO DATA
 


 
   Home |    Search |    Code Library |    Sponsors |    Privacy |    Terms of Use |    Contact Us © 2003 - 2024 psoug.org