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 :: change date format in oracle query 
Sql :: sql count group by 
Sql :: grant all privileges on a db 
Sql :: calculate distance between two latitude longitude postgresql 
Sql :: (PDOException(code: 2002): SQLSTATE[HY000] [2002] Permission denied at 
Sql :: postgres foreign key multiple columns 
Sql :: mysql add text to existing field 
Sql :: get primary key of table 
Sql :: count columns psql(PostreSQL) 
Sql :: MySQL server is running with the –secure-file-priv 
Sql :: postgresql get difference between two dates 
Sql :: how to change column name in sql 
Sql :: mysql separator 
Sql :: postgresql create query 
Sql :: mysql cashing error 
Sql :: vbscript connect mssql 
Sql :: create table in sql 
Sql :: mysql generate uuid 
Sql :: get record which is available in one table but not in another mysql 
Sql :: delete row psql 
Sql :: oracle sql pad left zeros 
Sql :: search mysql database for column 
Sql :: how to combine first and last nae into one columb sql 
Sql :: sql count number of rows after group by 
Sql :: function in plsql 
Sql :: mysql two column combination unique 
Sql :: SQL Error 1040 : Too many connections 
Sql :: how to count null values in sql 
Sql :: mysql delete duplicates 
Sql :: mssql dockere 
ADD CONTENT
Topic
Content
Source link
Name
6+7 =