Search
 
SCRIPT & CODE EXAMPLE
 

SQL

create table oracle

CREATE TABLE ot.persons(
    person_id NUMBER GENERATED BY DEFAULT AS IDENTITY,
    first_name VARCHAR2(50) NOT NULL,
    last_name VARCHAR2(50) NOT NULL,
    PRIMARY KEY(person_id)
);
Comment

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 :: identify primary key in oracle table 
Sql :: if null put 0 sql 
Sql :: Add colum sqlite table 
Sql :: find log file postgresql linux 
Sql :: uncheck constraints and delete from table 
Sql :: mysql for windows 10 64 bit 
Sql :: sql select all records from all tables where not empty 
Sql :: sql where contains part of string 
Sql :: mysql get max value and id 
Sql :: between 
Sql :: postgres parent and child tables 
Sql :: how to casting data types in postgresql 
Sql :: postgresql escape single quote 
Sql :: group by por mes sql mysql 
Sql :: delete table row in postgresql 
Sql :: how to delete database in mysql 
Sql :: php delete database 
Sql :: postgresql create table many-to-many 
Sql :: mysql alter table add column 
Sql :: delete vs truncate sql server 
Sql :: oracle undo tablespace list by user 
Sql :: mysqli auto increment id 
Sql :: full outer join postgres 
Sql :: how to update sql server version 
Sql :: add column mysql with foreign key 
Sql :: wamp server mysql password 
Sql :: first max salary in sql 
Sql :: change sql global mode 
Sql :: alter session set nls_language french 
Sql :: calculer pourcentage mysql 
ADD CONTENT
Topic
Content
Source link
Name
7+4 =