Oracle / PLSQL: CREATE TABLE AS Statement

The syntax for the CREATE TABLE AS statement that copies all of the columns in Oracle/PLSQL is:

CREATE TABLE new_table
  AS (SELECT * FROM old_table);

Example

Let’s look at a CREATE TABLE AS example that shows how to create a table by copying all columns from another table.

CREATE TABLE suppliers
AS (SELECT *
    FROM companies
    WHERE company_id < 5000);

 

Leave a Reply