I want to combine the content of two columns and insert it into a new column.
But it does not work. Example:
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
Result:
ERROR: NULL-Value in column „id“ error Not-Null-Constraint
DETAIL: Failed line contains (null, null, null, bmw 123).
How can I just update the specific row, and leave all other values as it is?
SELECT COALESCE(col_a, '') || COALESCE(col_b, '');1, bmw, 123, bmw 123)