不懂ORACLE,是不是类似这样:update 表1 set 字段=表2字段 from 表2 create table #a(a int, b varchar(5)) insert #a select 1,'a' insert #a select 2,'b' insert #a select 3,'c' select * from #a update #a set b=rtrim(a.a) from #a a --可from其他表 select * from #a
可用with (Locktype) 锁定
个人觉得mssql的 update talbe1 set column1='' from table2 join table 1 on ...where ...这个语法和楼主的类似
大家都理解错误了,楼主的意思是在查询分析器中 执行select * from table1 where .... for update(oracle中的语法),对查询出的数据,可以在结果表格里进行修改,然后点击保存提交按钮,将更改的数据保存到数据库中。 用过plsql的人应该都知道的吧。 for update相当与对select出的语句进行加锁,只能当前用户修改,其他用户不能修改删除。
SQL Server里只有UPDATE, 应和ORACLE差不多吧.
create table #a(a int, b varchar(5))
insert #a select 1,'a'
insert #a select 2,'b'
insert #a select 3,'c'
select * from #a
update #a set b=rtrim(a.a) from #a a --可from其他表
select * from #a
update talbe1 set column1='' from table2 join table 1 on ...where ...这个语法和楼主的类似
用过plsql的人应该都知道的吧。
for update相当与对select出的语句进行加锁,只能当前用户修改,其他用户不能修改删除。