Re: Copying specific fields from table to table
| From: | Robin Vickery | Date: | Mon, 25 Feb 2008 13:30:27 +0000 |
| Subject: | Re: Copying specific fields from table to table | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-270031@lists.php.net to get a copy of this message | ||
On 25/02/2008, Rob Gould <gouldimg@mac.com> 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.
MySQL?
This will update every row in table 2 to have the barcode from table 1.
UPDATE table2 INNER JOIN table1 USING (id) SET table2.barcode = table1.barcode;