给点数据出来看看? 要么就是1楼, update t set col ='value' where ...
内容不同就可以吗? 可以把每行更新成她自己的行号 update 表名 set 字段=row_id()
update 表名 set 字段=row_id()row_id是啥? lz这个问题问的,首先,你的内容不同是否有规律?如果没有,还是分开更新!!!
--猜楼主应该是相互更新的吧update tb set a=c,c=a
總有一個更新規則吧通過表update update a set col=b.col from b where a.ID=b.ID用列值updateupdate a set col=case when col>0 then 0 else 1 end--用when 按條件 update a set col=1 where id=1
update 表 字段='内容' where id=...
CREATE PROCEDURE Update_a @a int AS update 表 set 字段=@a where....GO
非常感谢6L,通過表update update a set col=b.col from b where a.ID=b.ID我用这个方法更新了
總有一個更新規則吧通過表update update a set col=b.col from b where a.ID=b.ID用列值updateupdate a set col=case when col>0 then 0 else 1 end--用when 按條件 update a set col=1 where id=1顶牛人
要么就是1楼,
update t
set col ='value'
where ...
可以把每行更新成她自己的行号
update 表名 set 字段=row_id()
lz这个问题问的,首先,你的内容不同是否有规律?如果没有,还是分开更新!!!
--猜楼主应该是相互更新的吧update tb set a=c,c=a
總有一個更新規則吧通過表update
update a
set col=b.col
from b
where a.ID=b.ID用列值updateupdate a
set col=case when col>0 then 0 else 1 end--用when 按條件
update a
set col=1
where
id=1
字段='内容'
where id=...
CREATE PROCEDURE Update_a
@a int
AS
update 表
set 字段=@a
where....GO
update a
set col=b.col
from b
where a.ID=b.ID我用这个方法更新了
總有一個更新規則吧通過表update
update a
set col=b.col
from b
where a.ID=b.ID用列值updateupdate a
set col=case when col>0 then 0 else 1 end--用when 按條件
update a
set col=1
where
id=1顶牛人