declare @a table(cat_id int,cat_name varchar(10),cat_name_bm varchar(10))
insert into @a select 1,'test_a','test'
union all select 2,'test_b','test'
union all select 2,'test_c','test_c'
select * from @a
select cat_id,case when cat_name_bm='test'then cat_name else cat_name_bm end cat_name from @a