Search
 
SCRIPT & CODE EXAMPLE
 

SQL

how to create an empty table from an existing table

CREATE TABLE suppliers 
  AS (SELECT * 
      FROM companies WHERE 1=2); 
Comment

Write a query to create an empty table from an existing table?

CREATE TABLE new_table
  AS (SELECT *
      FROM old_table WHERE 1=2);
Comment

PREVIOUS NEXT
Code Example
Sql :: exec procedure pl sql 
Sql :: declare value in sql 
Sql :: query to delete a database in mysql 
Sql :: mql5 datetime get hour 
Sql :: add foreign key to existing table postgres 
Sql :: oracle default date format 
Sql :: sql primary key syntax 
Sql :: format the money fied with comma in international system using sql 
Sql :: mysql find duplicate rows multiple columns 
Sql :: sql add column with default value 
Sql :: mysql query to find duplicate records 
Sql :: pl sql search in all packages 
Sql :: how to install mysql 8.0 windows service 
Sql :: error 1054 mysql 
Sql :: read xml in sql server 
Sql :: select odd records sql 
Sql :: create foreign key postgres 
Sql :: mysql datetime format 
Sql :: sql script to remove default from column 
Sql :: rand mysql 
Sql :: sql view index 
Sql :: oracle drop default value 
Sql :: create unique constraint postgres 
Sql :: what is relational database 
Sql :: sql composite key 
Sql :: mysqldump 1 table only 
Sql :: double in sql server example 
Sql :: group_concat mysql 
Sql :: enum in sql server 
Sql :: sqlite clear console 
ADD CONTENT
Topic
Content
Source link
Name
5+4 =