2 messages in com.mysql.lists.mysqlRE: Going mad over query
FromSent OnAttachments
Chris Thorpe03 Sep 2001 12:11 
Don Read03 Sep 2001 12:20 
Subject:RE: Going mad over query
From:Don Read (dre@texas.net)
Date:09/03/2001 12:20:49 PM
List:com.mysql.lists.mysql

On 03-Sep-2001 Chris Thorpe wrote:

I am (desperately) trying to update a field in table A with the result of a query on table B, as an example :

REPLACE INTO TableA (Value) SELECT COUNT(data1) FROM TableB WHERE data1 BETWEEN 2 AND 4

I need to modify this so that the result is stored (for example) where TableA.id=1, but at the moment it just appends to the end of Table A sorry if this is a dumb ass question!! I have scoured the manual etc, but cannot find how to include the reference to table A's id field as well!

REPLACE INTO TableA (id,value) SELECT 1,COUNT(data1) FROM TableB WHERE ...

Regards,