![image](/static/img/ProfessionslsCommunity.png)
I want to select the last record in the table and update its name.
Explain
UPDATE item
SET name = (SELECT name FROM pds
WHERE id = 9)
WHERE id=(SELECT id ORDER BY id DESC LIMIT 1);
However, when executing name is changed for all the records.
Tried also:
Explain
UPDATE item
SET name = (SELECT name FROM pds
WHERE id = 9)
WHERE id=(SELECT id FROM item ORDER BY id DESC LIMIT 1);