I would like to update my table with WHERE clause equals to result in my Subquery as you can see in the query below. The result after executing of query should be that the row with name Robert will have value to 1
CREATE TABLE `table1`(
`name` varchar(30),
`surname` varchar(30),
`nextname` varchar(30),
`value` bit(1)
);
INSERT INTO `table1`
VALUES
('Daniel', 'Hanks', 'Robert', 0),
('Robert', 'Pitt', 'Angelina', 0),
('Angelina', 'Jolie', 'Monica', 0),
('Monica', 'Red', null, 0);
UPDATE `table1` SET `value` = 1
WHERE `name` IN (SELECT `nextname` FROM `table1`
WHERE `name` = 'Daniel')¨
Thanks