Create Table From Select

suggest change

You may want to create a duplicate of a table. CREATE TABLE ... AS SELECT is not SQL Server syntax (SQL Server uses SELECT INTO):

CREATE TABLE ClonedEmployees AS SELECT * FROM Employees;

You can use any of the other features of a SELECT statement to modify the data before passing it to the new table. The columns of the new table are created from the selected expressions. In standard SQL, a string literal uses single quotes; double quotes delimit an identifier.

CREATE TABLE ModifiedEmployees AS
SELECT Id, CONCAT(FName, ' ', LName) AS FullName FROM Employees
WHERE Id > 10;

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents