if object_Id('testTb')is not null drop table testTb
go
create table testTb (A int , B int ,C int)
insert into testTb
select 1,2,3 union all
select 1,3,2 union all
select 2,1,3 union all
select 3,1,4
select
(case when A > B then A else B end) as E,
(case when B > C then B else C end) as F
from testTb
drop table testTb