I’m trying to get this to work but get an error t_write was not locked.
I’m updating the col make and the col sn from the highest value sn + 1
LOCK TABLES 1_makes AS t_read READ, 1_makes as t_write WRITE;
UPDATE t_write
SET
make = 'Pioneer',
sn = (SELECT
*
from
(SELECT
MAX(sn)
FROM
t_read
WHERE
id <> 0) as new_sn) + 1
WHERE
id = 2;
UNLOCK TABLES;
How about this: