Re: Copying specific fields from table to table

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On Feb 25, 2008, at 5:37 AM, Rob Gould wrote:

I've got 2 tables. One table which contains a series of barcodes assigned to product id #'s, and another table with JUST product id #'s.

I need to somehow transfer all the barcodes from the first table into the second table, but only where the id #'s match.

Can anyone tell me if this is something that can be done with just a SQL statement, or do I need to write a PHP script to loop through the records of both tables and do the copying/mapping?





Insert into T2 (bcode) select T1.bcode where T2.id = T1.id;


Bojan Tesanovic
http://www.classicio.com/
http://www.carster.us/




[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux