[CLUE-Tech] MySQL 3.23

Dan Harris dan at drivefaster.net
Wed Apr 21 01:37:06 MDT 2004


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...

update products set products.price = new_prices.price where products.id 
= new_prices.id;

I don't have MySQL but that seems like basic SQL stuff to me :)

-Dan



More information about the clue-tech mailing list