これを機能させようとしていますが、エラーが発生しますt_write was not locked.
make
colとcolsn
を最高値から更新しています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;