Create Table From Select
suggest changeYou 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;
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents