【发布时间】:2014-03-21 16:04:31
【问题描述】:
我需要在现有数据库中插入或替换,但它无法正常工作。
示例:
select * from tab where name = 'foo';
6530|foo|ok|||
insert or replace into tab values('foo', 'ok', 1, 2, 3);
select * from tab where name = 'foo';
6530|foo|ok|||
43523|foo|ok|1|2|3
为什么插入替换不会将现有字段“更新”到记录 6530 中而是创建一个新字段?
桌子:
create table tab(
id integer unique primary key,
name text not null,
tipo text not null,
val1 integer,
val2 integer,
val3 integer
);
【问题讨论】:
-
你的问题是什么插入或更新,因为你的查询太错误了,......所以,首先你应该清楚发布你的问题......
标签: sqlite sql-insert