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,
--
Don Read [EMAIL PROTECTED]
-- It's always darkest before the dawn. So if you are going to
steal the neighbor's newspaper, that's the time to do it.
(53kr33t w0rdz: sql table query)
---------------------------------------------------------------------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)
To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php