Search
 
SCRIPT & CODE EXAMPLE
 

SQL

oracle create as select

CREATE TABLE my_table AS
SELECT * FROM another_table t
WHERE 1=2 --delete the where condition if you also want the data
Comment

oracle sql create table from select

-- Copy a table (datas, columns and storage parameters)
CREATE TABLE my_new_table AS SELECT * FROM my_source_table;
-- Use NOLOGGING, and PARALLEL if allowed for faster copy
CREATE TABLE my_new_table
    PARALLEL 10 NOLOGGING
AS
SELECT /*+ parallel(10) */ * FROM my_source_table;
-- To create an empty table:
CREATE TABLE my_new_table AS SELECT * FROM my_source_table
	WHERE rownum = 0;
Comment

PREVIOUS NEXT
Code Example
Sql :: oracle show execution plan 
Sql :: alter tablespace add datafile 
Sql :: turn off safe mode mysql 
Sql :: postgres concat_ws 
Sql :: data types sql 
Sql :: check database status oracle 
Sql :: insert pg result of select 
Sql :: oracle schema size 
Sql :: mysql db size 
Sql :: mysql to lowercase 
Sql :: creer une base de donnée psql 
Sql :: sysdate in oracle sql 
Sql :: oracle db get table sizes 
Sql :: SQLSTATE[HY000]: General error: 1215 Cannot add foreign key constraint 
Sql :: select amount weeks between two dates mysql 
Sql :: convert date to datetime sql 
Sql :: clear a table in mysql 
Sql :: get ip from phpmyadmin 
Sql :: sql where contains 
Sql :: clear query cache sql server 
Sql :: mysql backup query 
Sql :: mysql update row 
Sql :: show tables in cassandra cql 
Sql :: allow external access to mysql 
Sql :: Write a query to create an empty table from an existing table? 
Sql :: snap remove mysql workbench 
Sql :: oracle drop temporary table 
Sql :: oracle insert into 
Sql :: how to truncate table with foreign key constraint postgresql 
Sql :: SQL Modify Column in a Table -MySQL 
ADD CONTENT
Topic
Content
Source link
Name
1+8 =