UPDATE syntax in SQLite

前端 未结 6 807
时光取名叫无心
时光取名叫无心 2020-12-31 02:47

I need to know if I can do this in an UPDATE statement:

UPDATE users SET (\'field1\', \'field2\', \'field3\') 
VALUES (\'value1\', \'value2\', \'value3\');
<         


        
6条回答
  •  隐瞒了意图╮
    2020-12-31 03:36

    What you posted is not the correct syntax for UPDATE. To UPDATE your syntax is:

    UPDATE users 
    SET field1 = 'value1',
        field2 = 'value2',
        field3 =  'value3';
    

    You will want to add a WHERE clause or this will UPDATE all records.

提交回复
热议问题