Is it possible to insert multiple rows at a time in an SQLite database?

后端 未结 24 2907
猫巷女王i
猫巷女王i 2020-11-21 06:12

In MySQL you can insert multiple rows like this:

INSERT INTO \'tablename\' (\'column1\', \'column2\') VALUES
    (\'data1\', \'data2\'),
    (\'data1\', \'da         


        
24条回答
  •  时光说笑
    2020-11-21 06:32

    On sqlite 3.7.2:

    INSERT INTO table_name (column1, column2) 
                    SELECT 'value1', 'value1' 
              UNION SELECT 'value2', 'value2' 
              UNION SELECT 'value3', 'value3' 
    

    and so on

提交回复
热议问题