Update table using joins and cases
UPDATE Property_New
SET PropertyNumber = ( CASE
WHEN property.StatusId= 4 THEN 1
when property.StatusId= 2 THEN 3
when property.StatusId= 3 THEN 1
when property.StatusId= 6 THEN 1
when property.StatusId= 7 THEN 1
when property.StatusId= 1 THEN 2
END )
FROM Property_New
inner join Property on Property_New.PropertyID=Property.Propertyid
where OrderId=1
Comments
Post a Comment