Pada Thu, 7 Nov 2002 21:35:00 -0600
"Doug Coning" <[EMAIL PROTECTED]> menulis:

> Hi everyone,
> 
> I'm still learning MySQL.  I have a database of 600 items.  I am still
> adding products.  Several of these products are identical in nature, but
> have maybe one or two columns that are different.  Is there a way to write a
> SQL command that selects these items and then inserts them, and then updates
> them respectively with one command?

i don't if there is another way, but i know this one :
you've to create temporary table ...

mysql> create table table2 select * from table1;
mysql> insert into table1 select * from table2;

you can also do something like this :
insert into table1(col1,col2,col3) select(col1,col2,"something") from table2;

-- 
Dicky Wahyu Purnomo - System Administrator
PT FIRSTWAP: Jl Kapt. Tendean No. 34 - Jakarta Selatan (12790)
Phone: +62 21 79199577 - HP: +62 8158787286
Web: http://www.1rstwap.com


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to