SQL server中判断当一个字段=7时这个字段为空怎么写

在SQL server数据库,我想判断当一个字段的值等于7的时候,将这条数据的这个字段为赋值为空应该怎么写呀

update 表 set 字段 = null where 字段 = 7

select case when 字段=7 then null else 字段 end as 字段 from table

可以使用case when的方法
刚好有一个表有数字值7的,用我这个表举个例子吧
效果如下

img

sql语句如下

select top 10 
id,
(case when domain_length=7 then '' else convert(varchar(10),domain_length) end) as domain_length,
domain_length as domain_old_value,
create_time
from domain_table
where domain_length in(3,5,7)