472,119 Members | 1,613 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,119 software developers and data experts.

How to insert the data of one table into the other

156 100+
Hi everybody
This is seshu here i am struck with one point i want to get the data of one table ie table1 ofcourse not the whole table only two out of five columns and i want to insert those two columns in an empty new table which is having five columns in which two of them are similar to the columns i have selected from table1
please help me out
Jan 12 '07 #1
1 5216
4,258 Expert 4TB
As always, the answer is in the MySQL manual, chapter INSERT Syntax

For your problem something like
Expand|Select|Wrap|Line Numbers
  1. INSERT INTO TargetTable (col1, col2, col3)
  2. SELECT col1,col2, col3
  3. FROM SourceTable
Ronald :cool:
Jan 12 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

9 posts views Thread by Martin | last post: by
6 posts views Thread by pk | last post: by
16 posts views Thread by Philip Boonzaaier | last post: by
5 posts views Thread by Paul Shaw | last post: by
16 posts views Thread by robert | last post: by
2 posts views Thread by Geoffrey KRETZ | last post: by
8 posts views Thread by nano2k | last post: by
6 posts views Thread by rn5a | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.