January 2012
Intermediate to advanced
542 pages
11h 28m
English
In this recipe we will see how to create a table as the result of a selection from other tables or views in the database.
The following steps demonstrate how to use use selection to create a table:
SH schema:
CONNECT sh@TESTDB/sh
MY_SALES, and copy the SALES table structure:
CREATE TABLE MY_SALES AS SELECT * FROM SALES WHERE ROWNUM < 1;
SALES table into MY_SALES using direct path inserting :SET TIMING ON INSERT /*+ APPEND */ INTO MY_SALES SELECT * FROM SALES; SET TIMING OFF
MY_SALES table:
DROP TABLE MY_SALES;
MY_SALES as a selection from SALES table:SET TIMING ON CREATE TABLE MY_SALES AS SELECT * FROM SALES; SET ...
Read now
Unlock full access