Background: I have an orders table that contains address columns. I would like to update these with randomly picked addresses taken from a temporary table
Both tables contain address, address1, city and postcode columns
I was thinking the query would be something like:
UPDATE orders (address, address1, city, postcode)
VALUE
(SELECT address, address1, city, postcode
FROM addresses
ORDER BY RAND()
LIMIT 1)
Edit: Note that it needs update all rows with different values.