469,643 Members | 1,486 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,643 developers. It's quick & easy.

How to Copy Table1 to Table2 ?

I have 2 tables in a database:

As an example, let's say Table1 has 20 rows, like this:

CategoryNumber CategoryName
1000 Radios
1001 CD Players
.... ...
1019 Older Electronics

Let's say Table 2 has 12 rows, like this
Column1 Column2 ProductCategory
0000001 Dan Old TVs
0000002 Steve Old Computers
.... ...
0000011 Debbie Old Guitars

How do I copy all rows of Table1 to Table2 in as few MySQL statements as
possible ?
In otherwords, without writing 20 separate SQL Insert statements ?

Also, the columns from Table1 go into Table2 as described below:
Table1.CategoryNumber ---> Table2.Column1
"Owners Unknown" ---> Table2.Column2
Table1.CategoryName ---> Table2.ProductCategory

Many thanks for your help and patience regarding this newbie question.

Jul 19 '05 #1
0 1095

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by JC-Atl | last post: by
2 posts views Thread by ja | last post: by
5 posts views Thread by Peter CCH | last post: by
4 posts views Thread by Dejan | last post: by
4 posts views Thread by GTi | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.