Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
节点mysql库是否可以使用子查询批量插入?
就像是
var data = [[1,2],[3,4]]; var qry = 'insert into tableA select ? from tableB where id = ?'; connection.query(qry,[data]);
在插入时指定列并将该列与子查询匹配。
INSERT INTO Table1 (Column1, Column2) SELECT column3, column4 FROM Table2 AS t2 WHERE t2.id = ?;