SQL code:
@id nvarchar(500)
insert into dance (a,b,c) value(0,0,0) Where id in (@id) and n=417
@id=1,2,3,4,5
我想把@id=1 =2 =3 =4 =5的这5条记录 and n=417 的a b c字段全部更新为0 请问各位大哥这样的语句怎么写?
SQL code:
update dance set a=0,b=0,c=0 where id in(1,2,3,4,5) and n=417
SQL code:
update
dance
set
a=0,b=0,c=0
where
charindex(','+ltrim(id)+',',','+@wher+',')>0 and n=417
SQL code:
insert into dance (a,b,c) value(0,0,0) Where charindex(','+ltrim(id)+',',','+@id +',')>0 and n=417
OR:
update dance set a=0,b=0,c=0 where charindex(','+ltrim(id)+',',','+@id+',')>0 and n=417
想要哪个
楼上的两位,抱歉我写错了,修改下:
·id=1,2,3,4,5
我想把@id=1 =2 =3 =4 =5的这5条记录 and n=417 的a b c字段全部添加到另一张表中,其中a,b,c要等于0, 请问各位大哥这样的语句怎么写?
SQL code:
insert into