?
Solved

Select into table

Posted on 2006-11-06
4
Medium Priority
?
1,164 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 30

Accepted Solution

by:
todd_farmer earned 2000 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

Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

Question has a verified solution.

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

As a database administrator, you may need to audit your table(s) to determine whether the data types are optimal for your real-world data needs.  This Article is intended to be a resource for such a task. Preface The other day, I was involved …
Creating and Managing Databases with phpMyAdmin in cPanel.
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…

752 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