22,209
社区成员
发帖
与我相关
我的任务
分享
update b set b.自己物品='手机'
from 留言 a,user b
where a.用户名=b.登陆用户名
and a.排序='getid'
update 留言 set 留言.交易地点=‘广州’
where
排序='getid'
--变成2条,貌似是这样的
update 留言
set 交易地点 = '广州'
from 留言 a
left join [user] b on a.用户名 = b.登陆用户名
where b.登陆用户名 is not null
and a.排序 = @getid
update [user]
set 自己物品 = '手机'
from [user] b
right join 留言 a on a.用户名 = b.登陆用户名
where b.登陆用户名 is not null
and a.排序 = @getid