List:General Discussion« Previous MessageNext Message »
From:Michael Widenius Date:July 5 1999 11:13am
Subject:Re: MySQL 3.22.24 released
View as plain text  
>>>>> "Kevin" == Kevin Smith <kevin@stripped> writes:

Kevin> Hi Monty,
Kevin> I posted a message a little while back about update queries and wondered 
Kevin> if the following could be implemented into MySQL as it seems that there 
Kevin> is a lack of functionality via update.

Kevin> Basically, like Oracle SQL, etc. you can join two tables with an UPDATE 
Kevin> query which will take one value from one table and replace that value in 
Kevin> the other where the two records match, it seems that REPLACE will not 
Kevin> work as you cannot join the same table you a getting the value from.

Kevin> The query would look something like this :

Kevin> ORACLE SQL

Kevin> UPDATE [tablename]
Kevin> SET [fieldname]=
Kevin> (SELECT [fieldname1] FROM [tablename1]
Kevin> WHERE ((([tablename].[fieldname])=([tablename1].[fieldname1])))
Kevin> );

Kevin> and if appropriate something similar from MS ACCESS SQL

Kevin> UPDATE DISTINCTROW CUSTOMERS
Kevin> INNER JOIN CUSTOMER_ADDRESS ON CUSTOMERS.id = CUSTOMER_ADDRESS.user_id
Kevin> SET CUSTOMERS.address_id = [CUSTOMER_ADDRESS].[id];

In MySQL 3.23 we plan to first implement the first case and in the
future the next version (even if the second version would be much
easier to implement)

As I will go on vacation on Thursday and we will attend 2 conferences
in August, it will probably take until September before we have sub
selects in MySQL 3.23.

Regards,
Monty
Thread
Re: MySQL 3.22.24 releasedMichael Widenius5 Jul