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 sql merge 
Sql :: ignore case like sql 
Sql :: add primary key with auto increment sql server 
Sql :: how to update random rows in sql 
Sql :: Assign value to var in SQL 
Sql :: how to find sql server agent jobs related to a database 
Sql :: sql cheat sheet pdf 
Sql :: sql column contains special character 
Sql :: show all tables postgres 
Sql :: rename field name in mysql 
Sql :: sql server list locks 
Sql :: postgres concat 
Sql :: oracle list columns in schema 
Sql :: cursor.execute in python sqlite3 
Sql :: sql server rtrim everything after character 
Sql :: n highest salary in sql 
Sql :: ascending order mysql 
Sql :: sql pagination oracle 
Sql :: remove unique key from a table 
Sql :: postgresql resolv duplicate value violates unique constraint 
Sql :: how to create a sql database 
Sql :: oracle tablespace tables list 
Sql :: oracle list grants on package 
Sql :: print hello world in plsql 
Sql :: full sql mode 
Sql :: how to query date in sql server 
Sql :: json query 
Sql :: mysql backup database 
Sql :: mysql timestamp format 
Sql :: inner join distinct 
ADD CONTENT
Topic
Content
Source link
Name
5+5 =