Create Table Using Another Table
CREATE TABLE new_table_name AS
SELECT column1, column2,...
FROM existing_table_name
WHERE ....;
Example:
CREATE TABLE TestTable AS
SELECT customername, contactname
FROM customers;
Example:
CREATE TABLE TestTable AS
SELECT customername, contactname
FROM customers WHERE customername='Siti';
Source: https://www.w3schools.com/sql/sql_create_table.asp
SELECT column1, column2,...
FROM existing_table_name
WHERE ....;
Example:
CREATE TABLE TestTable AS
SELECT customername, contactname
FROM customers;
Example:
CREATE TABLE TestTable AS
SELECT customername, contactname
FROM customers WHERE customername='Siti';
Source: https://www.w3schools.com/sql/sql_create_table.asp
Comments
Post a Comment