List:General Discussion« Previous MessageNext Message »
From:Sasha Pachev Date:June 18 1999 12:45pm
Subject:Re: MySQL Update Queries
View as plain text  
Kevin Smith wrote:
> 
> Hi Everyone,
> 
> I'm new to the list and to MySQL, but have had a good start with it! :-)
> 
> Anyhow, can anyone tell how to create an UPDATE using two tables.
> For example, how can I write a query similar to this..
> 
> UPDATE BASKET SET item=
> (SELECT DISTINCTROW PRODUCTS.item_id
> FROM BASKET, PRODUCTS
> WHERE (((BASKET.id)=(PRODUCTS.id)))
> );
> 
> Or something like that?
> 
> Regards,
> 
> Kevin Smith
> Lemon Lainey Design UK
> Website: http://www.lemonlaineydesign.com
> eMail: kevin@stripped

Try REPLACE INTO basket SELECT ...

-- 
Sasha Pachev
http://www.sashanet.com/ (home)
http://www.direct1.com/ (work)
Thread
MySQL Update QueriesKevin Smith18 Jun
Re: MySQL Update QueriesSasha Pachev18 Jun
Re: MySQL Update QueriesKevin Smith18 Jun
Re: MySQL Update QueriesSasha Pachev18 Jun