22,210
社区成员
发帖
与我相关
我的任务
分享
update a set a.roomid =ph.RoomID,a.custid=ph.custid,a.parkid=ph.ParkID,a.handid=ph.HandID
from hongslabqf77 a
left join Tb_HSPR_Parking p on p.ParkName=a.dybh and p.CommID=197006
left join Tb_HSPR_Parkinghand ph on ph.ParkID=p.ParkID
where ph.ParkID is not null and a.roomid is null
是不是这个CommID=197006的问题,在这个前面加上p.。变成上面这样再试试看
update a set a.roomid =ph.RoomID,a.custid=ph.custid,a.parkid=ph.ParkID,a.handid=ph.HandID
from hongslabqf77 a
left join Tb_HSPR_Parking p on p.ParkName=a.dybh and CommID= 197006
left join Tb_HSPR_Parkinghand ph on ph.ParkID=p.ParkID
where ph.ParkID is not null and a.roomid is null
这样试试看