Solved

Select into table

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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
mysql left join sentence 7 37
sql_mode 1 24
Restore of mysql database from .SQL file - using Coldfusion 5 34
MySQL Query Using Up Memory 6 21
This guide whil teach how to setup live replication (database mirroring) on 2 servers for backup or other purposes. In our example situation we have this network schema (see atachment). We need to replicate EVERY executed SQL query on server 1 to…
Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.

815 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

9 Experts available now in Live!

Get 1:1 Help Now