日期:2014-05-17 浏览次数:20794 次
create table af
(inf2232_pay1 int,inf2234_pay3 int,inf2235_pay4 int,code varchar(10))
insert into af
select 10,20,30,'001' union all
select 100,60,80,'002' union all
select 20,90,10,'003'
update af
set inf2232_pay1=case when inf2232_pay1>inf2234_pay3 and inf2232_pay1>inf2235_pay4
then inf2232_pay1 else 0 end,
inf2234_pay3=case when inf2234_pay3>inf2232_pay1 and inf2234_pay3>inf2235_pay4
then inf2234_pay3 else 0 end,
inf2235_pay4=case when inf2235_pay4>inf2232_pay1 and inf2235_pay4>inf2234_pay3
then inf2235_pay4 else&