在使用此查询在 mysql 表中插入多行后,我试图获取 insertid
insert into sometable (id , candidateid , createdby)
values ('61','3175','1425'),('60','3175','1425'),('42','3175','1425'),('61','3176','1425'),('60','3176','1425'),('42','3176','1425') OUTPUT INSERTED.id
但我收到 sql 语法错误
code: 'ER_PARSE_ERROR', errno: 1064, sqlMessage: "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 'OUTPUT INSERTED.id' at line 2", sqlState: '42000',
如何获取插入ID
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号