Answer the question
In order to leave comments, you need to log in
How to update the value of a field in mysql relative to another field's relationship?
Good afternoon,
I want to transfer data from a link table to the main one ( m_products.photo = mc_photo.id )
Created a new text field photo_var
Tried such a query, but caught
UPDATE m_products
SET photo_var = mc_photo.name
from mc_photo
WHERE m_products.photo = mc_photo.id;
Answer the question
In order to leave comments, you need to log in
If I'm not mistaken, it's like this:
UPDATE m_products, mc_photo
SET m_products.photo_var = mc_photo.name
WHERE m_products.photo = mc_photo.id;
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question