update field

UPDATE dbo.HotelPolicy  SET HPFactorMark=TB.MarkValue FROM
 
(select HPF.HPFRPolicyId AS ID ,CONVERT(int,ISNULL(SUM(POWER(2,HPF.HPFRFactorId-1)),0)) AS MarkValue
 FROM HotelPolicyFactorRelation  HPF
 inner join dbo.HotelPolicy  HP on HPF.HPFRPolicyId=HP.Id
 WHERE HPF.HPFRFactorId NOT IN (5,7,8,9)
 GROUP BY  HPF.HPFRPolicyId
) AS TB
 WHERE HotelPolicy.Id=TB.ID

上一篇:java SE学习之线程同步(详细介绍)


下一篇:从使用到原理学习Java线程池