0

I have a MySQL database and I need to update table rows with values from another table. For example in one table there is a list of addresses which are stored for a specific customer. There is one address entry per customer and this address ID is stored in the Customers table in each customer entry under "address_id" column. I would like to know if it's possible to run a query which will update a list of addresses with the id's of the customers. So for each address row which id is found in customer row should have customer id in the specific column. Thanks in advance!

user2549830
  • 61
  • 1
  • 1
  • 4
  • The task is easy if there is no misprints. Read Reference Manual, UPDATE syntax, multiple-table syntax. – Akina May 18 '22 at 10:05
  • I don't understand you don't need to store customer id in address table if customer already has a pointer to address (address_id) and you only have 1 address per customer. – P.Salmon May 18 '22 at 10:09

0 Answers0