In my table, id
is the primary key, but this code not working in sqlite3:
insert into text (id,text) VALUES(150574,'Hello') ON DUPLICATE KEY UPDATE 'text' = 'good'
Please help me.
In my table, id
is the primary key, but this code not working in sqlite3:
insert into text (id,text) VALUES(150574,'Hello') ON DUPLICATE KEY UPDATE 'text' = 'good'
Please help me.
INSERT .... ON DUPLICATE
don't exist in SqLite. But you can useINSERT OR REPLACE
to achieve the effect like the following.Ref: http://www.sqlite.org/lang_insert.html