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 :: how to delete git repo locally 
Sql :: oracle list privileges 
Sql :: select tables from mysql database 
Sql :: grant all priviledges to mysql user 
Sql :: oracle asynchronous procedure 
Sql :: add new column not null sql server 
Sql :: oracle explain plan 
Sql :: ORACLE SHOW AVAILABLE DB LINK 
Sql :: python escape string for sql 
Sql :: insert pg result of select 
Sql :: sQL query to get all table records count from a database 
Sql :: sql server date format dd/mm/yyyy 
Sql :: sql like 
Sql :: tsql cmd exec script from file 
Sql :: mysqli_connect using prepare statement 
Sql :: psql datetime grather than 
Sql :: sql delete join 
Sql :: sqlserver docker 
Sql :: grant all privileges mysql 
Sql :: mysql remove duplicates 
Sql :: mysql start command 
Sql :: postgresql how to show table names 
Sql :: date format in sql 
Sql :: get count of duplicate records 
Sql :: 2nd highest salary in mysql 
Sql :: oracle trigger 
Sql :: how to print mysql query of codeigniter query builder 
Sql :: oracle drop temporary table 
Sql :: postgres cast as decimal 
Sql :: mariadb add foreign key 
ADD CONTENT
Topic
Content
Source link
Name
5+8 =