当前位置 : 主页 > 数据库 > mssql >

sql 取代游标的写法示例

来源:互联网 收集:自由互联 发布时间:2021-04-05
Update Tb_Garden1 G Set Steward = (Select Id From Zyq.Tb_User U Where Replace(U.Name, '区') = G.Name And Rownum =1)where exists (select 1 from zyq.tb_user u where Replace(U.Name, '区') = G.Name And rownum = 1)
Update Tb_Garden1 G Set Steward = (
Select Id From Zyq.Tb_User U Where Replace(U.Name, '区') = G.Name And Rownum =1)
where exists (select 1 from zyq.tb_user u where Replace(U.Name, '区') = G.Name And rownum = 1) 
网友评论