如何在sql的某个列中预先添加某个值。我想在foo.value上说“100_”前缀并更新。我应该怎么做呢?
create table foo (id, value, ...)
insert into foo (1, 1);
insert into foo (2, 1);
insert into foo (3, 3);
insert into foo (4, 2);
insert into foo (5, 3);
insert into foo (6, 6);
答案 0 :(得分:2)
value
列必须为varchar
数据类型。
UPDATE Foo SET Value = '100_' + Value