Solved

Select into table

Posted on 2006-11-06
4
1,152 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 142

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 142

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

Free Gift Card with Acronis Backup Purchase!

Backup any data in any location: local and remote systems, physical and virtual servers, private and public clouds, Macs and PCs, tablets and mobile devices, & more! For limited time only, buy any Acronis backup products and get a FREE Amazon/Best Buy gift card worth up to $200!

Join & Write a Comment

Introduction In this article, I will by showing a nice little trick for MySQL similar to that of my previous EE Article for SQLite (http://www.sqlite.org/), A SQLite Tidbit: Quick Numbers Table Generation (http://www.experts-exchange.com/A_3570.htm…
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 …
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

707 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now