Creating Tables Using SELECT
Answer / mohammadali.info
*SELECT...INTO essentially combines CREATE TABLE and SELECT in a single statement. The AS clause can be used to change the column labels and thus control the column names in the new table. The other commands in the figure show the new table's structure and contents.
-SELECT firstname, lastname, city, state
INTO newfriend
FROM friend;
-SELECT...INTO tablename can also be written as CREATE TABLE tablename AS SELECT.... The preceding query can then be rewritten as
CREATE TABLE newfriend AS SELECT firstname, lastname, city, state FROM friend.
| Is This Answer Correct ? | 3 Yes | 1 No |
What are the parts of a function?
How do I edit a procedure in sql server?
Will sql server 2005 allow you to reduce the size of a column?
How do I find my localdb version?
What is a sql join?
What are the new data types are introduced in sql 2000?
Can we insert data if clustered index is disabled?
What are the built in functions in sql server?
What are the benefits of using stored procedures over sql statements?
What are the types of table?
Any one plz send me SQL Server Developer/DBA resume for 4 years experience
What is the purpose of UPDATE STATISTICS?
Oracle (3253)
SQL Server (4518)
MS Access (429)
MySQL (1402)
Postgre (483)
Sybase (267)
DB Architecture (141)
DB Administration (291)
DB Development (113)
SQL PLSQL (3330)
MongoDB (502)
IBM Informix (50)
Neo4j (82)
InfluxDB (0)
Apache CouchDB (44)
Firebird (5)
Database Management (1411)
Databases AllOther (288)