在 MySQL 中我会使用
INSERT INTO `mytable` (`col1`, `col2`)
VALUES (1, 'aaa'), (2, 'bbb');
但这会导致 SQLite 中出现错误。 SQLite 的正确语法是什么?
之前已经在这里回答过这个问题:是否可以在 SQLite 数据库中一次插入多行? https://stackoverflow.com/questions/1609637/is-it-possible-to-insert-multiple-rows-at-a-time-in-an-sqlite-database
回答您对 OMG Ponies 的评论:
从版本 3.7.11 开始,SQLite 确实支持多行插入。理查德希普评论:
"The new multi-valued insert is merely syntactic suger (sic) for the compound insert.
There is no performance advantage one way or the other."
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)