回答

收藏

如何在SQLite 3表中插入多行?

技术问答 技术问答 304 人阅读 | 0 人回复 | 2023-09-14

在MySQL中,我会使用* v( k# q# |! D/ W1 l3 A" P
INSERT INTO `mytable` (`col1`,`col2`) VALUES  (1,'aaa bbb');但这会导致SQLite错误。SQLite什么是正确的语法?% T. O+ u/ O; a* z+ X
                                                               
" k. t1 p) Q9 C- ~    解决方案:                                                               
6 N6 c7 ~9 h% B9 t                                                                在此之前,我已经回答了这个问题:我能一次吗?SQLite多行插入数据库?" [# O9 G# m0 J: f4 M, V* ^/ U
要回答您对OMG Ponies请回答:
% O0 c' G1 D; d) t6 [从3.7.11版本开始,SQLite确实支持多行插入。·希普(Richard Hipp)评论:0 c( P2 Y- @8 i
"The new multi-valued insert is merely syntactic suger (sic) for the compound insert. There is no performance advantage one way or the other."
分享到:
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则