[CLUE-Tech] MySQL 3.23

David L. Willson DLWillson at TheGeek.NU
Wed Apr 21 13:30:20 MDT 2004


The answer ended up being a combination of Greg's and Dan's answers. 
According to the documentation, I should have been able to use a REPLACE
INTO, but that didn't work, so, in a fit of irritation, I just upgraded
to 4.0, and ran the following: (example names have been replaced with
real names)
UPDATE products, new_prices SET products_price=price WHERE
products_model=new_prices.product_id;
The only difference between my statement and Dan's is that I called
'new_prices' into the context of the query.

On Tue, 2004-04-20 at 23:12, David Willson wrote:
> I need to UPDATE a field in one table with the corresponding
> information in another table.
> I have two tables:
> Products (
>   Id integer,
>   Price decimal(6,2)
>   )
> and
> New_Prices (
>   Id integer,
>   Price decimal(6,2)
>   )
>  
> I need to use the New_Prices.Price to overwrite the Products.Price. 
> How do I do it?  Anyone?  Anyone?  As an additional motivator, this is
> ~easy~ in PostgreSQL.  Actually, I'm certain this is easy, and I'm
> just missing it...




More information about the clue-tech mailing list