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 |
Is it true that rules do not apply to data already existing in a database at the time the rule is created?
What are 3 ways to get a count of the number of records in a table?
Explain a differential backup?
What is coalesce and check constraint in sql server?
What is the purpose of update statistics and scope_identity() function?
What is query optimizer in sql server?
Why I can not enter 0.001 second in date and time literals in ms sql server?
what are the problems in logshipping?
How to make remote connection in database?
Difference Between ORDER BY Clause and GROUP BY Clause in SQL?
What is Primary key and foreign key? Give an example
I create a separate index on each column of a table. What are the advantages and disadvantages of this approach? : Sql server database administration
Oracle (3259)
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)