我收到此语句的语法错误。知道为什么吗?
我唯一的猜测是会话记录可能已从选择中锁定,因此无法在同一事务中删除。但这似乎不会导致语法错误。
insert into sessions_history
select *
from sessions
where session_id = 'jjmn6hmuor8mqa2j1vb4gdpno0';
delete from sessions
where session_id = 'jjmn6hmuor8mqa2j1vb4gdpno0';
这是错误:
错误号:1064
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'delete from sessions where session_id = 'vk744qiebkfr0el7tesi65us04'' at line 1
insert into sessions_history select * from sessions where session_id = 'vk744qiebkfr0el7tesi65us04'; delete from sessions where session_id = 'vk744qiebkfr0el7tesi65us04';
有任何想法吗?