I'm trying to transfer the color
field value from the dress
table to the purchase
table as I'm changing my DB's structure slightly.
Here's the query, it's simple enough but I keep getting the error.
UPDATE purchase
SET purchase.color = (SELECT dress.color
FROM dress INNER JOIN purchase
ON dress.ID = purchase.dressID);
I've also tried without JOIN and putting the condition in the WHERE clause but I get the same error.
UPDATE purchase
SET purchase.color = (SELECT dress.color
FROM dress, purchase
WHERE dress.ID = purchase.dressID);
I've also read that this error is sometimes due to the file being "read only" or other issues with permission, I've tried everything but nothing seems to work.
Edit: also tried this but I get "missing operator" error
UPDATE purchase
SET purchase.color = dress.color
FROM dress INNER JOIN purchase ON dress.ID = purchase.dressID;