Posted by MattMika on 07/27/06 17:17
On Wed, 26 Jul 2006 17:15:28 -0600, MattMika <mattmika@hotmail.com>
wrote:
>I recently changed the field length for products_model in our products
>table from varchar(12) to varchar(15) and failed to update that field
>in our orders_products table. So now I have incomplete model #'s in
>our orders_products table.
>
>I am unsure how to go about doing this in a query. Maybe something
>like this?:
>
>UPDATE orders_products SET products_model = (SELECT products_model
>from products)
>WHERE products.products_id = orders_products.products_id;
>
>Any suggestions would be greatly appreciated.
>TIA
>Matt Mika
I copied my tables and tested. Changed the above to:
UPDATE orders_products SET products_model = (SELECT products_model
from products WHERE products.products_id =
orders_products.products_id);
Worked like a charm...
Matt Mika
Navigation:
[Reply to this message]
|