我想合并两列的内容并将其插入新列。
但它不起作用。 例如:
create table car(
id bigint NOT NULL,
manufacture character varying(255),
number character varying(255),
result character varying(255)
)
insert into car (result)
select concat(manufacture, ' ', number) from car
结果:
ERROR: NULL-Value in column „id“ error Not-Null-Constraint
DETAIL: Failed line contains (null, null, null, bmw 123).
如何更新特定行,并保留所有其他值不变?
答案 0 :(得分:3)
update car set result = concat(manufacture, ' ', number)