Solved

Select into table

Posted on 2006-11-06
4
1,157 Views
Last Modified: 2008-03-04
Is it possible to do a select statement that creates a NEW table?

SELECT * FROM TABLE ONE INTO NEW TABLE ?
0
Comment
Question by:K3HT
  • 2
4 Comments
 
LVL 30

Accepted Solution

by:
todd_farmer earned 500 total points
ID: 17883463
CREATE TABLE new_table AS SELECT * FROM old_table;
0
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 17883528
I think the AS is not correct in mysql:

http://dev.mysql.com/doc/refman/5.0/en/create-table.html
CREATE TABLE new_table SELECT * FROM old_table;
0
 
LVL 33

Expert Comment

by:snoyes_jw
ID: 17883565
It's in the documentation, and a quick test shows that it works.
0
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 17883596
I stand corrected. I did not see the  [AS] in the definition of the "select statement" ...
0

Featured Post

Active Directory Webinar

We all know we need to protect and secure our privileges, but where to start? Join Experts Exchange and ManageEngine on Tuesday, April 11, 2017 10:00 AM PDT to learn how to track and secure privileged users in Active Directory.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Popularity Can Be Measured Sometimes we deal with questions of popularity, and we need a way to collect opinions from our clients.  This article shows a simple teaching example of how we might elect a favorite color by letting our clients vote for …
Foreword This article was written many years ago, in the days when PHP supported the MySQL extension (http://php.net/manual/en/function.mysql-connect.php).  Today (http://php.net/manual/en/migration70.removed-exts-sapis.php) you would not use MySQL…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

827 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question