更新时间:2023-12-04 12:52:52
好吧,你需要构造一行:
Well, you need to construct the line:
INSERT INTO ... VALUES (1,7,3000), (1,8,3500), (1,9,3900)
试试那个:
rows = [(1,7,3000), (1,8,3500), (1,9,3900)]
values = ', '.join(map(str, rows))
sql = "INSERT INTO ... VALUES {}".format(values)