/////////// Sql Query
------------------------- Insert table
to table all data
SELECT * INTO newTableName FROM oldTableName WHERE Condition;
------------------------- Insert table
to table selected columns
SELECT s.CustomerName, s.OrderID INTO CustomersOrderBackup2017
FROM Customers s LEFT JOIN Orders o ON o.CustomerID = s.CustomerID
------------------------- Insert table
to table selected columns with conditions
SELECT s.CustomerName, s.OrderID INTO CustomersOrderBackup2017
FROM Customers s LEFT JOIN Orders o ON o.CustomerID = s.CustomerID WHERE Condition;
No comments:
Post a Comment