A
A
Andrey Lepaskaln2020-05-25 19:21:38
MySQL
Andrey Lepaskaln, 2020-05-25 19:21:38

How to change the value of the parent row and with it the child?

Hello, I have such a question, I need to use a query to change the value of the cell, which is the foreign key of the main table and at the same time change them in the child.
Example:

Main table:
Name
value1 Child

table:
Name
value1
value1
value1

Name is a foreign key.
Thank you in advance)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Rsa97, 2020-05-25
@holoron

If this is a FOREIGN KEY with the ON UPDATE CASCADE option, then it will change itself when the value in the main table changes.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question