sqlite3 更新字段的问题,请各位大神来指点迷津
如题,我想实现
update table Name=Name+@Name where ID=@ID
--> 测试数据:[表一]
if object_id('[表一]') is not null drop table [表一]
create table [表一]([xh] int,[zym] varchar(10))
insert [表一]
select 1,'资源1' union all
select 2,'资源2' union all
select 3,'资源3' union all
select 4,'资源4' union all
select 5,'资源5' union all
select 6,'资源6'
declare @name varchar(3)
set @name='zyn'
declare @xh int
set @xh=2
update [表一]
set [zym]=[zym]+@name where [xh]=@xh
select * FROM [表一]
--我的一个例子,没任何问题
/*
xhzym
1资源1
2资源2zyn
3资源3
4资源4
5资源5
6资源6
*/
update t
set name = isNull(name, '') + @Name
where id = @ID