update companys set Fid=(select top 1 Fid from ProContent where ProContent.公司名称=companys.公司名称 and Fid is not null),Sid=(select top 1 Sid from ProContent where ProContent.公司名称=companys.公司名称 and Sid is not null),Tid=(select top 1 Fid from ProContent where ProContent.公司名称=companys.公司名称 and Sid is not null) where where Fid is null