查询的话
select a,case when a<>1 then NULL else b end as b from tab;
修改b的值的话
update tab set b= case when a<>1 then NULL else b end